#include using namespace std; int f(int a){ int cnt=0; while(a){ cnt++; a/=10; } return cnt; } signed main(){ int ans=0; vector v(5); for(int i=0;i<5;i++)cin>>v[i]; for(int p:v){ if(p%3==0)ans+=4; if(p%5==0)ans+=4; if(p%3&&p%5)ans+=f(p); } cout<