#include using namespace std; using i64 = long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); auto solve = [&]() { int ans = 0; for (int i = 0; i < 5; i++) { int x; cin >> x; if (x % 15 == 0) { ans += 8; } else if (x % 3 == 0 || x % 5 == 0) { ans += 4; } else { ans += to_string(x).size(); } } cout << ans << '\n'; }; solve(); return 0; }