import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Vector;

public class L_alt
{
	StreamTokenizer in;
	Scanner inr;
    PrintWriter out;

    int nextInt() throws IOException
    {
    	in.nextToken();
    	return (int)in.nval;
    }
    
    void input() throws IOException
    {
   		inr = new Scanner(System.in);
   		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    	out = new PrintWriter(new OutputStreamWriter(System.out));
    }
    
    class Polyominoe implements Comparable<Polyominoe>
    {
    	int n, m;
    	int a[][];
    	
    	public Polyominoe(int b[][], boolean f)
    	{
    		int xmin = 10000, xmax = -1;
    		int ymin = 10000, ymax = -1;
    		for (int i = 0; i < b.length; i++)
    			for (int j = 0; j < b[0].length; j++)
    				if (b[i][j] != 0)
    				{
    					if (xmin > i)
    						xmin = i;
    					if (xmax < i)
    						xmax = i;
    					if (ymin > j)
    						ymin = j;
    					if (ymax < j)
    						ymax = j;
    				}
    		n = xmax - xmin + 1;
    		m = ymax - ymin + 1;
    		a = new int[16][16];
    		for (int i = xmin, x = 0; i <= xmax; i++, x++)
    			for (int j = ymin, y = 0; j <= ymax; j++, y++)
    				a[x][y] = b[i][j];
		}

    	public Polyominoe(int b[][], int n, int m)
    	{
    		a = b;
    		this.n = n;
    		this.m = m;
		}    	
    	
    	public Polyominoe flip_hor()
    	{
    		int b[][] = new int[16][16];
    		for (int i = 0; i < n; i++)
    			for (int j = 0; j < m; j++)
    				b[i][j] = a[n-i-1][j];
    		return new Polyominoe(b, n, m);
    	}
    	
    	public Polyominoe flip_ver()
    	{
    		int b[][] = new int[16][16];
    		for (int i = 0; i < n; i++)
    			for (int j = 0; j < m; j++)
    				b[i][j] = a[i][m-j-1];
    		return new Polyominoe(b, n, m);
    	}
    	
    	public Polyominoe rotate()
    	{
    		int b[][] = new int [16][16];
    		for (int i = 0; i < n; i++)
    			for (int j = 0; j < m; j++)
    			{
    				b[m-j-1][i] = a[i][j];
    			}
    		return new Polyominoe(b, m, n);
    	}

		@Override
		public int compareTo(Polyominoe p)
		{
			if (n != p.n)
				return n - p.n;
			if (m != p.m)
				return m - p.m;
			for (int i = 0; i < n; i++)
				for (int j = 0; j < m; j++)
					if (a[i][j] != p.a[i][j])
						return a[i][j] - p.a[i][j];
			return 0;
		}
		
		@Override
		public boolean equals(Object p)
		{
			if (p instanceof Polyominoe)
			{
				Polyominoe pp = (Polyominoe) p;
				return compareTo(pp) == 0;
			}
			return super.equals(p);
		}
		
		public void print()
		{
			System.out.println(n + " x " + m);
			for (int i = 0; i < n; i++)
			{
				for (int j = 0; j < m; j++)
					System.out.print(a[i][j] + " ");
				System.out.println();
			}
			System.out.println();
		}
		
		public long toArray()
		{
			int cnt = 0;
			long t = 0;
			for (int i = 0; i < n; i++)
				for (int j = 0; j < m; j++)
				{
					if (a[i][j] != 0)
						t |= 1<<cnt;
					cnt++;
				}
			return t;
		}
    }
    
    int n, m, k, res;
    
    int a[][] = new int[21][21];
    
    int dx4[] = {-1, 0, 1, 0};
    int dy4[] = {0, 1, 0, -1};
    
    HashSet<Polyominoe> set = new HashSet<Polyominoe>();
    
    void output()
    {
    	out.println(res);
    	out.flush();
    }
    
    HashSet<Long> v[][] = new HashSet[11][11];
    
    public boolean inSet(Polyominoe pp)
    {
    	Long p = pp.toArray();
    	for (int i = 0; i < v[pp.n][pp.m].size(); i++)
    		if (v[pp.n][pp.m].contains(p))
    			return true;
    	return false;
    }
    
    public void add(Polyominoe p)
    {
    	if (!inSet(p))
    	{
    		v[p.n][p.m].add(p.toArray());
    	}
    }

    void add(int f)
    {
    	Polyominoe p = new Polyominoe(a, true);
    	if (inSet(p)) return;
    	//p.print();
    	res += f;
    	Polyominoe flh = p.flip_hor();
    	for (int i = 0; i < 4; i++)
    	{
    		add(p);
    		add(flh);
    		if (i == 3) break;
    		p = p.rotate();
    		flh = flh.rotate();
    	}
    }
    
    void gen(int xmin, int xmax, int ymin, int ymax, int left)
    {
    	int dx = xmax - xmin + 1;
    	int dy = ymax - ymin + 1;
    	if ((dx > n || dy > m) && (dx > m || dy > n))
    		return;
    	if (left == 0)
    		add(1);
    	else
    	{
    		if (inSet(new Polyominoe(a, true)))
    			return;
    		add(0);
    		for (int x = xmin; x <= xmax; x++)
    			for (int y = ymin; y <= ymax; y++) if (a[x][y] == 1)
		    		for (int k = 0; k < 4; k++)
		    		{
		    			int xx = x + dx4[k];
		    			int yy = y + dy4[k];
		    			if (a[xx][yy] == 0)
		    			{
		    				a[xx][yy] = 1;
		    				gen(xmin < xx ? xmin : xx, xmax > xx ? xmax : xx, ymin < yy ? ymin : yy, ymax > yy ? ymax : yy, left - 1);
		    				a[xx][yy] = 0;
		    			}
		    		}
    	}
    }
    
    void solve()
    {
    	res = 0;
    	for (int i = 0; i < v.length; i++)
    		for (int j = 0; j < v[i].length; j++)
    			v[i][j] = new HashSet<Long>();
    	a[10][10] = 1;
    	gen(10, 10, 10, 10, k - 1);
    }
    
    int r[][][] = new int [12][12][12];
    
    void run() throws Exception
    {
		input();
		k = inr.nextInt();
		n = inr.nextInt();
		m = inr.nextInt();
		if (n < m){int t = n; n = m; m = t;}
		solve();
		output();
    }
    
	public static void main(String[] args) throws Exception
	{
		new L_alt().run();
	}
	
    void print(Object s)
    {
    	System.err.println(s.toString());
    }
}
