#include #include #include #include int main() { //std::ifstream inf("Text.txt"); std::cin.rdbuf(inf.rdbuf()); int ans = 0; std::vector a(5); for (int i = 0; i < 5; i++) { std::cin >> a[i]; if (a[i] % 15 == 0) { ans += 8; } else if (a[i] % 5 == 0) { ans += 4; } else if (a[i] % 3 == 0) { ans += 4; } else { ans += static_cast(std::log10(a[i]) + 1); } } std::cout << ans << std::endl; return 0; }