# coding utf-8 n = int(input()) # 1 ~ 9 -> 1<=n<=9 # 10 ~ 99 -> 10=n<=10+90*2 # 100 ~ 999 -> 10+90*2<=n<=10+90*2+900*3 if int(n/10) == 0: print(n) else: amari = int(n % 10) sho = int(n/10) if int(amari%2) != 0: if int(sho%2) != 0: sho = 0 else: sho = 1 print(int(amari/2)+int(sho*5)) else: print(int(sho/2)+int(sho%2))