Having watched the last Harry Potter film, little Gerald also decided to practice magic. He found in his father's magical book a spell that turns any number in the sum of its digits. At the moment Gerald learned that, he came across a number *n*. How many times can Gerald put a spell on it until the number becomes one-digit?
The first line contains the only integer *n* (0 ≤ *n* ≤ 10<sup class="upper-index">100000</sup>). It is guaranteed that *n* doesn't contain any leading zeroes.
0
0
10
1
991
3
99
2
100
1
123456789
2
32
1
86
2
2
0
8
0
34
1
13
1
28
2
23
1
57
2
29
2
353869285
3
549548646
2
858893424
2
644818852
3
360322525
3
122937520
2
288403032
2
677257481
3
58059561
3
211288847
2
339900034079539584
2
784084029310269952
3
774730557264864000
3
478233807148352256
3
165646874056812544
3
477533739511673792
3
660119944377002240
3
448375218506078080
3
77213334785795616
3
165767221702271872
3
1
0
5
0
8
0
156161456146164104103460452045416165146141414651641564105461465156445621465146514562146145465165145145614561465145614561
3
9
0
import os
import sys
import collections
from io import BytesIO, IOBase
from math import ceil,floor,sqrt,sin,cos,tan,factorial,inf
BUFSIZE=8192
class FastIO(IOBase):
    newlines=0
    def __init__(self, file):
        self._file=file
        self._fd=file.fileno()
        self.buffer=BytesIO()
        self.writable="x" in file.mode or "r" not in file.mode
        self.write=self.buffer.write if self.writable else None
    def read(self):
        while True:
            b=os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:break
            ptr=self.buffer.tell()
            self.buffer.seek(0, 2),self.buffer.write(b),self.buffer.seek(ptr)
        self.newlines=0
        return self.buffer.read()
    def readline(self):
        while self.newlines==0:
            b=os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines=b.count(b"\n")+(not b)
            ptr=self.buffer.tell()
            self.buffer.seek(0, 2),self.buffer.write(b),self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer=FastIO(file)
        self.flush=self.buffer.flush
        self.writable=self.buffer.writable
        self.write=lambda s:self.buffer.write(s.encode("ascii"))
        self.read=lambda:self.buffer.read().decode("ascii")
        self.readline=lambda:self.buffer.readline().decode("ascii")
sys.stdin=IOWrapper(sys.stdin)
sys.stdout=IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
cout = sys.stdout.write
data = collections.Counter
queue= collections.deque
endl = lambda:sys.stdout.write("\n")
ii = lambda: int(input())
fi = lambda: float(input())
si = lambda: input().rstrip()
mi = lambda: map(int,input().split())
mf = lambda: map(float,input().split())
msi= lambda: map(str,input().strip().split(" "))
li = lambda: list(mi())
lf = lambda: list(mf())
ls = lambda: list(msi())
arrsi=lambda:list(si())  
set_ii=lambda: set(li())
set_fi=lambda: set(lf())
set_si=lambda: set(input())
def ipow(x,y):return int(pow(x,y))
def maps(arr):return map(str,arr)
def push(a,n):return a.append(n)
def YES(): sys.stdout.write("YES\n")
def Yes(): sys.stdout.write("Yes\n")
def yes(): sys.stdout.write("yes\n")
def NO(): sys.stdout.write("NO\n")
def No(): sys.stdout.write("No\n")
def no(): sys.stdout.write("no\n")
def NOT():sys.stdout.write("NOT\n")
class Solution:
    def __init__(self):
        return
    def solve(self):
        s=si()
        n=s.count("0")
        if len(s)==n:sys.stdout.write("0\n")
        else:
            sys.stdout.write(f"{len(s)-n}\n")
            




if __name__ == "__main__":
    Solution().solve()