//
//  main.cpp
//  CppTest
//
//  Created by Ryu on 2017/02/08.
//  Copyright ?? 2017??´ Ryu. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n[50];
    int comb[50];
    int m = 0;
    while (cin >> n[m]) {
        if(n[m] <= 18){
            if (n[m] <= 9) {
                comb[m] = powl(4, n[m]);
            }else{
                comb[m] = powl(4, n[m]);
                for (int i = n[m]; i >= 9; i--) {
                    comb[m] -= powl(3, n[m] - 9) * 4;
                }
            }
        }else if(n[m] <= 36){
            n[m] = 36 - n[m];
            if (n[m] <= 9) {
                comb[m] = powl(4, n[m]);
            }else{
                comb[m] = powl(4, n[m]);
                for (int i = n[m]; i >= 10; i--) {
                    comb[m] -= powl(3, n[m] - i) * 4;
                }
            }
        }else{
            comb[m] = 0;
        }
        m++;
    }
    
    for (int i = 0; i < m; i++) {
        printf("%d\n", comb[i]);
    }
    printf("\n");
    
    return 0;
}