#include <bits/stdc++.h>

typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;


char type[3] = {'a', 'b', 'c'};

ll memo[1000][1000][1000][3];

ll solve(ll n, ll m, ll k, char turn){
    if(memo[n][m][k][turn-'a'] != -1)   return memo[n][m][k][turn-'a'];
    ll sum = 0;
    if(turn == type[0]){
        if(n == 0)  return pow(3, m+k);
        sum += solve(n-1, m, k, 'a');
        sum += solve(n-1, m, k, 'b');
        sum += solve(n-1, m, k, 'c');
    }
    if(turn == type[1]){
        if(m == 0)  return 0;
        sum += solve(n, m-1, k, 'a');
        sum += solve(n, m-1, k, 'b');
        sum += solve(n, m-1, k, 'c');
    }
    if(turn == type[2]){
        if(k == 0)  return 0;
        sum += solve(n, m, k-1, 'a');
        sum += solve(n, m, k-1, 'b');
        sum += solve(n, m, k-1, 'c');
    }
    memo[n][m][k][turn-'a'] = sum;
    return sum;
}

int main(){
    ll n, m, k;
    cin >> n >> m >> k;
    rep(i, 1000){
        rep(j, 1000){
            rep(t, 1000){
                rep(c, 3)   memo[i][j][t][c] = -1;
            }
        }
    }

    cout << solve(n, m, k, 'a') << endl;

    return 0;
}