All problems

Problem 773

Count Digits

Easy · 10 pts · Math, Basics

Problem

Count how many digits a non-negative integer N has, written in base 10 without leading zeros. The number 0 has one digit. You can repeatedly divide by 10 until the number becomes 0, counting the steps (treat 0 separately), or read the number as a string and take its length. N can be as large as 10^18. The numbers in this problem can be larger than a 32-bit int can hold (about 2.1 × 10^9), so use a 64-bit integer type: long long in C++, long in Java (Python needs nothing special).

Input

A single integer N without leading zeros.

Output

Print the number of digits of N.

Constraints

0 <= N <= 10^18

Example input

12345

Example output

5

Explanation

12345 has the digits 1, 2, 3, 4 and 5, so it has 5 digits. Dividing by 10 five times reaches 0, which agrees.

Every problem here can be used in a RelayTrixCode team match. Create a room.

Previous: Multiplication Table Next: Product of Digits