#include #include #include #include using namespace std; typedef long long int ll; int num(int n){ int cnt=0; while(n){ cnt++; n/=10; } return cnt; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int ans=0; for(int i=0;i<5;i++){ int a; cin >> a; if(a%15==0)ans+=8; else if(a%3==0)ans+=4; else if(a%5==0)ans+=4; else ans+=num(a); } cout << ans << endl; }