#include<iostream> using namespace std; int main() { int n,sum=8; cin>>n; if(n>=1000){ if(n%500==0){ sum+=(n-1000)/500*4; } else sum+=(n-1000)/500*4+4; } sum+=n/100*12; cout<<sum; }