#include <bits/stdc++.h>
using namespace std;
int v[10],f[1005],ans;
const int r[7] = {0,1,2,3,5,10,20};
void dfs (int y,int tot){
if (y > 6){
f[tot] = 1;
}else{
for (int i = 0 ; i <= v[y] ; i++){
dfs (y + 1,tot + (i * r[y]));
}
}
}
int main(){
for (int i = 1 ; i <= 6 ; i++) cin >> v[i];
dfs (1,0);
for (int i = 1 ; i <= 1000 ; i++){
if (f[i]){
ans++;
}
}
printf ("Total=%d",ans);
return 0;
}