#include #include using namespace std; int main(int argc, const char * argv[]) { int sum = 0; for (int i = 0; i < 5; i++) { int a; cin >> a; if (a % 3 == 0 && a % 5 == 0) { sum += 8; } else if (a % 3 == 0) { sum += 4; } else if (a % 5 == 0) { sum += 4; } else { int cal = int(log10(a)) + 1; sum += cal; } } cout << sum << endl; return 0; }