#include // #include using namespace std; // using bigint = boost::multiprecision::cpp_int; template using min_priority_queue = priority_queue,greater>; random_device seed_gen; mt19937 engine(seed_gen()); int64_t get_time_ns(){ struct::timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return t.tv_sec * int64_t(1'000'000'000) + t.tv_nsec; } int main() { int n = 5; vector A(n); for(int &a : A) cin >> a; int ans = 0; for(int a : A) { if(a % 15 == 0) ans += 8; else if(a % 5 == 0) ans += 4; else if(a % 3 == 0) ans += 4; else ans += to_string(a).size(); } cout << ans << endl; return 0; }