l = [3, 2, 2, 2, 3, 2, 3, 2, 4, 3] n = int(raw_input()) ret = 1 while n != 0: ret += l[n%10] n /= 10 print ret