rt
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n;
int f[25][25][25];
int dfs(int x,int y,int z)
{
if(x<=0 || y<=0 || z<=0)
{
return 1;
}
if(x>20 || y>20 || z>20)
{
return dfs(20,20,20);
}
if(f[x][y][z])
{
return f[x][y][z];
}
if(x<y && y<z)
{
f[x][y][z]=dfs(x,y,z-1)+dfs(x,y-1,z-1)-dfs(x,y-1,z);
}
else
{
f[x][y][z]=dfs(x-1,y,z)+dfs(x-1,y-1,z)+dfs(x-1,y,z-1)-dfs(x-1,y-1,z-1);
}
return f[x][y][z];
}
int a,b,c;
signed main()
{
while(1)
{
cin>>a>>b>>c;
if(a==-1 && b==-1 && c==-1)
{
break;
}
cout<<"w("<<a<<", "<<b<<", "<<c<<") = "<<dfs(max((long long)0,min((long long)20,a)),max((long long)0,min((long long)20,b)),max((long long)0,min((long long)20,c)))<<endl;;
}
return 0;
}