Beautiful Emails
At AUCPL Inc., HR has pushed for professionalism and kind yet productive language in emails. They have thus installed an advanced AI model that rates the professionalism of each sent email as an integer so that they can be reprimanded or praised. However, in your wisdom, your team is actually using email as a means of machine-to-machine communication, with many emails sending a single integer.
The AI model still rates the professionalism of your single-integer email somehow, and you have derived the model for how it works. An integer is 'beautiful' all of its digits are the same. Here are some examples: ,
,
, etc. Your overall email professionalism score is the amount of beautiful numbers that divide the integer in your email. Can you calculate the professionalism score for a bunch of your automated emails so HR doesn't put you on an improvement plan?
Input
The input contains a single integer (
), the integer sent in your email.
Output
Output a single integer, the professionalism score of your email. I.e. the amount of beautiful numbers (numbers whose digits are all the same) divide . Do not count
as a beautiful number that divides
.
Example
Input 1
12
Output 1
5
,
,
,
, and
all divide
and are beautiful.
Input 2
3996
Output 2
12
,
,
,
,
,
,
,
,
,
,
,
all divide
. Zowie!
Input 3
99999999999
Output 3
6
,
,
,
,
,
are the only beautiful divisors.
Comments