def solve(): li = input().split(' ') cnt = 0 for s in li: n = int(s) if (n % 3 == 0 and n % 5 == 0): cnt += 8 # FizzBuzz elif (n % 3 == 0 or n % 5 == 0): cnt += 4 # Fizz or Buzz else: cnt += len(s) print(cnt) solve()