#include <fstream>
#include <string>
using namespace std;
ifstream fin ("fmcz.in");
ofstream fout ("fmcz.out");
int main()
{
int a1,a2,a3,a4,a5,a6,count=0;
bool mass[1001]={false};
int i,j,k,m,n,q;
fin>>a1>>a2>>a3>>a4>>a5>>a6;
for (i=0;i<=a1;i++)
for (j=0;j<=a2;j++)
for (k=0;k<=a3;k++)
for (m=0;m<=a4;m++)
for (n=0;n<=a5;n++)
for (q=0;q<=a6;q++)
/// if ((i+2*j+3*k+5*m+10*n+q*20)!=0)
mass[(i+2*j+3*k+5*m+10*n+q*20)]=true;
for (int i=1;i<=1000;i++)
if (mass[i]==true)count++;
fout<<count<<endl;
return 0;
}