#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; int ans = 0; while(cin >> n) { if(n % 15 == 0) { ans += 8; cerr << "FB "; } else if(n % 5 == 0 || n % 3 == 0) { ans += 4; cerr << "F "; } else { while(n > 0) { ans++; n /= 10; } cerr << "N "; } cerr << ans << endl; } cout << ans << endl; return 0; }