import java.util.Scanner;
class FindGold
{
private static int m,n,k;
private static boolean[][] visited;
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
m=sc.nextInt();
n=sc.nextInt();
k=sc.nextInt();
visited=new boolean[m][n];
System.out.println(dfs(0,0));
}
private static int dfs(int x,int y)
{
if(x<0 || y<0 || x>=m || y>=n || visited[x][y] || sumOfDigits(x)+sumOfDigits(y)>k )
{
return 0;
}
visited[x][y]=true;
return 1+dfs(x+1,y)+dfs(x-1,y)+dfs(x,y+1)+dfs(x,y-1);
}
private static int sumOfDigits(int num)
{
int sum=0;
while(num!=0)
{
sum=num%10;
num=num/10;
}
return sum;
}
}