n = int(input()) d, m = divmod(n, 500) if m >= 100: d += 1 print(d)