#include #define int long long using namespace std; signed main() { int A; int ans = 0; for( int i=0; i < 5; i++ ){ cin >> A; if( A%3 == 0 && A%5 == 0 ) ans += 8; else if(A%3 == 0 || A%5 == 0 ) ans += 4; else{ string S = to_string(A); ans += S.size(); } } cout << ans << endl; }