#include using namespace std; int main(){ int i; int k = 0; vector a(5); for( i = 0 ; i < 5 ; i= i + 1 ){ cin >> a.at(i); if( a.at(i) % 3 == 0 && a.at(i) % 5 == 0 ) k += 8; else if( a.at(i) % 3 == 0 ) k += 4; else if( a.at(i) % 5 == 0 ) k += 4; else if( a.at(i) < 10 ) k += 1; else if( a.at(i) < 100 ) k += 2; else if( a.at(i) < 1000 ) k += 3; } cout << k << endl; return 0; }