#include <iostream>
using namespace std;
int
ans[1001], a[1001], cnt, sigmaw;
const int
weight[7] = { 0, 1, 2, 3, 5, 10, 20 };
void
__read__()
{
for( int i = 1; i <= 6; i++ )
{
int x;
cin >> x;
for( int j = 1; j <= x; j++ )
{
a[++cnt] = weight[i];
sigmaw += weight[i];
}
}
}
void
__init__()
{
for( int i = 1; i <= cnt; i++ )
ans[a[i]] = true;
}
void
__dp__()
{
ans[0] = true;
for( int i = 1; i <= cnt; i++ )
for( int j = sigmaw; j >= a[i]; j-- )
ans[j] = ans[j - a[i]] || ans[j];
}
void
__outp__()
{
int count = 0;
for( int i = 1; i <= sigmaw; i++ )
if( ans[i] )
count++;
cout << "Total=" << count << endl;
}
int
main()
{
__read__();
__dp__();
__outp__();
return 0;
}