#include using namespace std; using ll = long long; int main() { int a, p = 0; for (int i = 0; i < 5; i++) { cin >> a; if (a % 3 == 0) p += 4; if (a % 5 == 0) p += 4; if (a % 3 != 0 && a % 5 != 0) p += to_string(a).size(); } cout << p << endl; }