import numpy as np import itertools H, W, K = map(int, input().split()) st = set() for t in itertools.product(range(K), repeat=H * W): if len(set(t)) != K: continue grid = np.array(t).reshape((H, W)) g4 = np.tile(grid, (2, 2)) for h, w in itertools.product(range(H), range(W)): if tuple(g4[h:h + H, w:w + W].flatten()) in st: break else: st.add(tuple(grid.flatten())) print(len(st))