unittest
{
	assert( [ "2 3 2", "..#", "###" ].solve == 5 );
	assert( [ "2 3 4", "..#", "###" ].solve == 1 );
	assert( [ "2 2 3", "##", "##" ].solve == 0 );
	assert( [ "6 6 8", "..##..", ".#..#.", "#....#", "######", "#....#", "#....#" ].solve == 208 );
}



import std.conv;
import std.format;
import std.range;
import std.stdio;

void main()
{
	stdin.byLineCopy.solve.writeln;
}

auto solve( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto h = 0L;
	auto w = 0L;
	auto k = 0L;
	input.front.formattedRead!"%s %s %s"( h, w, k );
	auto css = new dchar[][]( h, w );
	foreach( ref cs; css )
	{
		input.popFront;
		cs = input.front.to!( dchar[] );
	}
	
	auto ans = 0L;
	foreach( hb; 0L .. 1L << h )
	{
		foreach( wb; 0L .. 1L << w )
		{
			auto t = 0L;
			foreach( y; 0L .. h )
			{
				foreach( x; 0L .. w )
				{
					t += ( ( hb & ( 1L << y ) ) != 0 && ( wb & ( 1L << x ) ) != 0 && css[ y ][ x ] == '#' );
				}
			}
			ans += ( t == k );
		}
	}
	return ans;
}
