#include #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define pb push_back #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) FOR(i, 0, n) #define ll long long using namespace std; const ll P = 1000000007; int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; } int lcm(int a, int b) { return a / gcd(a, b) * b; } int main() { cout << fixed << setprecision(10); int a1,a2,a3,a4,a5; cin >> a1 >> a2 >> a3 >> a4 >> a5; int sum = 0; vector vec(5); vec = {a1,a2,a3,a4,a5}; rep(i,5) { if(vec[i]%3!=0&&vec[i]%5!=0) { sum += 1; } else if(vec[i%3==0&&vec[i]%5==0]) { sum += 8; } else { sum += 4; } } cout << sum << endl; return 0; }