#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <time.h>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#define ll long long
using namespace std;
ll rec[25][25][25];
ll srh(ll a,ll b,ll c){
if(a<=0||b<=0||c<=0)
return rec[a][b][c]=1;
else if(rec[a][b][c]!=0)
return rec[a][b][c];
else if(a>20||b>20||c>20)
return rec[a][b][c]=srh(20,20,20);
else if(a<b&&b<c)
return rec[a][b][c]=srh(a,b,c-1)+srh(a,b-1,c-1)-srh(a,b-1,c);
else
return rec[a][b][c]=srh(a-1,b,c)+srh(a-1,b-1,c)+srh(a-1,b,c-1)-srh(a-1,b-1,c-1);
}
ll x,y,z;
int main(){
while(scanf("%lld%lld%lld",&x,&y,&z)&&x!=-1&&y!=-1&&z!=-1){
memset(rec,0,sizeof(rec));
printf("w(%lld, %lld, %lld) = %lld\n",x,y,z,srh(x,y,z));
}
system("pause");
return 0;
}