#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Would #define you int digits(int n) { int ans = 0; while (n) { ans += n % 10; n /= 10; } return ans; } int k[10], ans; int main() { for (int i = 0; i < 5; ++i) { cin >> k[i]; if (k[i] % 15 == 0) { ans += 8; } else if (k[i] % 3 == 0 || k[i] % 5 == 0) { ans += 4; } else { ans += digits(k[i]); } } cout << ans << endl; }