#include <iostream>
#include <string.h>
#include<stdio.h>
using namespace std;
int w(int a,int b,int c);
int d[25][25][25];
int main()
{
int a,b,c;
memset(d,0,sizeof(d));
while(cin>>a>>b>>c&&(a!=-1||b!=-1||c!=-1))
{
printf("w(%d, %d, %d) = ",a,b,c);
cout<<w(a,b,c)<<endl;
}
return 0;
}
int w(int a,int b,int c)
{
if(a<=0||b<=0||c<=0)
return 1;
if(a>20||b>20||c>20)
return 1048576;
// if(d[a][b][c]!=0)
//return d[a][b][c];
if(a<b&&b<c)
{
d[a][b][c]=w(a,b,c-1)+w(a,b-1,c-1)-w(a,b-1,c);
return d[a][b][c];
}
else
{
d[a][b][c]=w(a-1,b,c)+w(a-1,b-1,c)+w(a-1,b,c-1)-w(a-1,b-1,c-1);
return d[a][b][c];
}
}