#include #define rep(i,a,n) for (int i = a;i < n;i++) #define per(i,n,a) for (int i = n-1;i >= a;i--) using namespace std; int a[10]; int main() { rep(i, 0, 5) { cin >> a[i]; } int c = 0; rep(i, 0, 5) { if (a[i] % 3 == 0 && a[i] % 5 == 0) { c += 8; } else if ((a[i] % 3 == 0 && a[i] % 5 != 0) || (a[i] % 3 != 0 && a[i] % 5 == 0)) { c += 4; } else if (a[i] % 3 != 0 && a[i] % 5 != 0) { if (1 <= a[i] && a[i] <= 9) { c += 1; } else if (10 <= a[i] && a[i] <= 99) { c += 2; } else if (100 <= a[i] && a[i] <= 999) { c += 3; } } } cout << c << endl; }