42. Count the Digits

Acceptance — 0 accepted 0 submissions

Easy
LoopsMath
No companies listed
A mobile number has 10 digits and a PIN code has 6. Given any non-negative number n, count how many digits it has, using maths, not string length.

Input Format
A single integer n.

Output Format
Print the number of digits in n.

Constraints
• 0 ≤ n ≤ 10^18

Example 1

Input
9876543210
Output
10

Explanation A 10-digit number, like a mobile number.

Example 2

Input
560001
Output
6

Explanation A 6-digit PIN code.

Example 3

Input
0
Output
1

Explanation Zero is written with one digit.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
10
No results yet
Run your code to test it against the sample cases.
Problem List