n = int(input()) a = n while True : if a >= 200: n -= 50 a -= 200 if 200 > a >= 100: n -= 20 a -= 100 if a < 100: break print(n)