#include<iostream> using namespace std; int main(){ int a,c=8; char b cin>>a,b; if(a>=1000){ if((a-1000)%500==0){ c+=(a-1000)/500*4; }else{ c+=((a-1000)/500+1)*4; } } if(b==y){ c+=5; } cout<<"17"; }