#include <iostream>
using namespace std;
static int table[21][21][21] = {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 w(20, 20, 20);
if(table[a][b][c]!=0) return table[a][b][c];
if(a<b && b<c) {
if(table[a][b][c-1]==0) table[a][b][c-1]=w(a,b,c-1);
if(table[a][b-1][c-1]==0) table[a][b-1][c-1]=w(a,b-1,c-1);
if(table[a][b-1][c]==0) table[a][b-1][c]=w(a,b-1,c);
table[a][b][c]= table[a][b][c-1]+table[a][b-1][c-1]-table[a][b-1][c];
return table[a][b][c];
}
else {
if(table[a-1][b][c]==0) table[a-1][b][c]=w(a-1,b,c);
if(table[a-1][b-1][c]==0) table[a-1][b-1][c]=w(a-1,b-1,c);
if(table[a-1][b][c-1]==0) table[a-1][b][c-1]=w(a-1,b,c-1);
if(table[a-1][b-1][c-1]==0) table[a-1][b-1][c-1]=w(a-1,b-1,c-1);
table[a][b][c] = table[a-1][b][c]+table[a-1][b-1][c]+table[a-1][b][c-1]-table[a-1][b-1][c-1];
return table[a][b][c];
}
}
int main() {
while(true) {
int a, b, c;
cin >> a >> b >> c;
if(a==-1 && b==-1 && c==-1) break;
std::cout << "w(" << a << ", " << b << ", " << c << ") = " << w(a, b, c) << "\n";
}
}