#include #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; void input(vector &v) { string src, str; getline(cin, src); stringstream ss{src}; while (getline(ss, str, ' ')) v.emplace_back(stoi(str)); } int anotherFizzBuzz(int x) { if (x % 15 == 0) return 8; if (x % 3 == 0 and x % 5 != 0) return 4; if (x % 3 != 0 and x % 5 == 0) return 4; return log10(x) + 1; } void solve() { vector v; input(v); int ans = 0; rep(i, 0, v.size()) ans += anotherFizzBuzz(v[i]); cout << ans << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); solve(); }