#include int main() { int cnt; int n; scanf("%d", &n); cnt = n / 500; if(n % 500 >= 100)cnt++; printf("%d\n", cnt); return 0; }