#include #include #include #include using namespace std; typedef long long int lont; int main() { int cnt = 0; int A; int B; for (int ia = 0; ia < 5; ia++) { cin >> A; if (1 <= A&&A <= 9)B = 1; if (10 <= A && A <= 99)B = 2; if (100 <= A && A <= 999)B = 3; if (A % 3 == 0 && A % 5 == 0)cnt += 8; if (A % 3 == 0 && A % 5 != 0)cnt += 4; if (A % 3 != 0 && A % 5 == 0)cnt += 4; if (A % 3 != 0 && A % 5 != 0)cnt += B; } cout << cnt << endl; }