//#include #include using namespace std; //using namespace atcoder; using ll = long long; #define all(A) A.begin(),A.end() using vll = vector; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) using Graph = vector>; int main() { ll an=0; rep(i,5){ ll N; cin>>N; if(N%15==0)an+=8; else if(N%5==0)an+=4; else if(N%3==0)an+=4; else if(N>=100)an+=3; else if(N>=10)an+=2; else an++; } cout<