Harryxun/stf_run huggingface dataset:
import math
a,b,C = map(float,raw_input().split())
C = C/180 + math.pi

S = a*b*math.sin(C)/2.0;
L = a + b + sqrt(pow(b*math.sin(C),2.0) + pow(a-b*math.cos(C),2))
h = b*math.sin(C)
print "%f\n%f\n%f\n" % (S,L,h)

### FIXED CODE ###

import math
 
a,b,C = map(float,raw_input().split())
C = C / 180.0 * math.pi

S = a * b * math.sin(C) / 2.0
L = math.sqrt(pow(b * math.sin(C), 2) + pow(a - b * math.cos(C), 2)) + a + b
h = b * math.sin(C)

print "%f\n%f\n%f\n" % (S,L,h)
from math import ceil
N,K=map(int, input().split())

A=list(map(int, input().split()))

left=0
right=10**9+1
ans=float("INF")
while True:
    mid=(left+right)//2
    now=0
    for i in range(N):
        now+=ceil(A[i]/mid)-1

    if now>K:
        if left==mid:
            break
        left=mid
    else:
        ans=min(ans, mid)
        if right==mid:
            break
        right=mid

print(ans)

### FIXED CODE ###

from bisect import bisect_right
from math import ceil
N,K=map(int, input().split())
A=list(map(int, input().split()))
if K==0:
    print(max(A))
    exit()

A=sorted(A)
# 最小値で二分探索 してまだ行けるかどうか
# 回数で二分探索
left=0
right=max(A)

ans=float("INF")
pre=ans
flag=False
count=0
while True:
    now=0
    mid=(left+right)/2
    idx=bisect_right(A, mid)
    for i in range(idx, N):
        now+=ceil(A[i]/mid)-1
    if now==K:
        if ans!=float("INF"):
            if ans==ceil(mid):
                flag=True
        ans=min(ans, ceil(mid))
        right=mid
        
        #if flag:
        #    break
        pre=ans
    if now>K:
        left=mid
        pre=mid
    if now<K:
        ans=min(ans, ceil(mid))
        right=mid
        pre=mid
    count+=1
    if count>=10**2:
        break
    


if ans==float("INF"):
    ans=max(A)
print(ceil(ans))
n = int(input())
l = list(input())
pi = int(input())
qi = int(input())
 
for i in range(n):
	l[i] = i+1
 
p = list(map(int, input().split()))
q = list(map(int, input().split()))
 
m = itertools.permutations(l, n)
 
for i in range(n):
	if l[i] == p
  	pi = i
    
    if l[i] == q
    qi = i
 
print(abs(pi-qi))

### FIXED CODE ###

import itertools
 
n = int(input())
p = tuple(map(int,input().split()))
q = tuple(map(int,input().split()))
 
l = [i for i in range(1,n+1)] 
 
x = 0
y = 0
 
m = list(itertools.permutations(l))
 
for i in range(len(m)):
	if m[i] == p:
  		x = i+1
	if m[i] == q:
 		y = i+1
        
print(abs(x-y))
r = int(input())
import math
pi = math.pi
s = r*r*pi
l = 2*r*pi
print("{:.6f}".format(s),"{:.6f}".format(l))


### FIXED CODE ###

r = float(input())
from math import pi
s = r*r*pi
l = 2*r*pi
print("{:.6f}".format(s),"{:.6f}".format(l))
import sys
input = sys.stdin.readline

def main():
    n = input()
    n_sum = sum([int(c) for c in n])
    if n % n_sum == 0:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    n = int(input())
    n_sum = sum([int(c) for c in str(n)])
    if n % n_sum == 0:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
n = int(input())
count = 0
for i in range(n):
  x = int(input())
  for j in range(x - 1):
    if x == 2:
      count += 1
    elif x % 2 == 0:
      continue
    else:
      if x % j != 0:
        count += 1
print(count)

### FIXED CODE ###

n = int(input())
count = 0
for i in range(n):
  x = int(input())
  if x == 2:
    count += 1
  elif x % 2 == 0:
    continue
  else:
    if pow(2, x - 1, x) == 1: 
      count += 1
print(count)
def merge(A, left, mid, right):

    n1 = mid-left
    n2 = right-mid
    #L = [0 for i in range(n1+1)]
    #R = [0 for i in range(n2+1)]
    #for i in range(n1):
    #    L[i] = A[left+i]
    #for i in range(n2):
    #    R[i] = A[mid+i]
    L = A[left:mid]
    R = A[mid:right]
    L.append(float('inf'))
    R.append(float('inf'))
    i = 0
    j = 0
    global cnt

    for k in range(left, right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i = i+1
        
        else:
            A[k] = R[j]
            j = j+1
            cnt += l-i

def mergeSort(A, left, right):
    if left+1 < right:
         mid = (left+right) // 2
         mergeSort(A, left, mid)
         mergeSort(A, mid, right)
         merge(A, left, mid, right)
    else:
        return 0

n = input()
A = list(map(int, input().split()))
cnt = 0
mergeSort(A, 0, len(A))
#print(*A)
print(str(cnt))

### FIXED CODE ###

def merge(A, left, mid, right):

    n1 = mid-left
    n2 = right-mid
    #L = [0 for i in range(n1+1)]
    #R = [0 for i in range(n2+1)]
    #for i in range(n1):
    #    L[i] = A[left+i]
    #for i in range(n2):
    #    R[i] = A[mid+i]
    L = A[left:mid]
    l = len(L)
    R = A[mid:right]
    L.append(float('inf'))
    R.append(float('inf'))
    i = 0
    j = 0
    global cnt

    for k in range(left, right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i = i+1
        
        else:
            A[k] = R[j]
            j = j+1
            cnt += l-i

def mergeSort(A, left, right):
    if left+1 < right:
         mid = (left+right) // 2
         mergeSort(A, left, mid)
         mergeSort(A, mid, right)
         merge(A, left, mid, right)
    else:
        return 0

n = input()
A = list(map(int, input().split()))
cnt = 0
mergeSort(A, 0, len(A))
#print(*A)
print(str(cnt))
H, W=map(int,input().strip().split(' '))

V=10
E=45
inf=10**9

def w_f():
    for i in range(10):
        c=list(map(int,input().strip().split(' ')))
        for j in range(10):
            cost[i][j]=c[j]

    for i in range(V):
        for j in range(V):
            for k in range(V):
                cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j])
    return cost


d=w_f()

ans=0
for i in range(H):
    a=list(map(int,input().strip().split(' ')))
    for j in range(W):
        if a[j]!=-1:
            ans+=d[a[j]][1]

print(ans)

### FIXED CODE ###

H, W=map(int,input().strip().split(' '))

cost=[]
for i in range(10):
    cost.append(list(map(int,input().strip().split(' '))))

for k in range(10):
    for i in range(10):
        for j in range(10):
            cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j])
ans=0
for i in range(H):
    a=list(map(int,input().strip().split(' ')))
    for j in a:
        if j!=-1:
            ans+=cost[j][1]
print(ans)
a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]
t = int(input())

if (a[0]<b[0]) .and. (b[1]*t + (b[0]-a[0]) - a[1]*t) < 0:
    print("YES")
elif:if (a[0]>b[0]) .and. (b[1]*t + (b[0]-a[0]) - a[1]*t) > 0:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]
t = int(input())

dis = abs(a[0]-b[0])

if (b[1]*t+dis) <= a[1]*t:
    print("YES")
else:
    print("NO")
N = list(map(int, input().split()))
K = map(int, input().split())
l = 0
i = 0
std = sorted(N, reverse = True)
while i < K:
  l += std[i]
  i += 1

### FIXED CODE ###

N, K = map(int, input().split())
l = list(map(int, input().split()))
std = sorted(l, reverse = True)
print(sum(std[0:K]))
if K >= N:
    print(0)
elif K == 0:
    answer = np.sum(H)
    print(answer)
else:
    ind = np.argpartition(H, -K)[-K:]
    print(ind)
    top_k = H[ind]
    answer = np.sum(H) - np.sum(top_k)
    print(answer)

### FIXED CODE ###

import numpy as np
N, K = map(int,input().split())
H = np.array(list(map(int,input().split())))

if K >= N:
    print(0)
elif K == 0:
    answer = np.sum(H)
    print(answer)
else:
    ind = np.argpartition(H, -K)[-K:]
    top_k = H[ind]
    answer = np.sum(H) - np.sum(top_k)
    print(answer)
N=int(input())
A=list(map(int, input().split()))
odd=[]
even=[]
for i in A:
    if i%2:
        odd.append(i)
    else:
        even.append(i)

ls=[]
for i in range(30):
    ls.append(2<<i)

ans=0
for i in range(len(odd)):
    ct=0
    for j in range(len(odd)-1):
        if i!=j:
            if odd[i]+odd[j] in ls:
                ct+=1
                tmpi=i
                tmpj=j
    if ct==1:
        odd.pop(tmpi)
        odd.pop(tmpj)
        ans+=1
for i in range(len(even)):
    ct=0
    for j in range(len(even)-1):
        if i!=j:
            if even[i]+even[j] in ls:
                ct+=1
                tmpi=i
                tmpj=j
    if ct==1:
        even.pop(tmpi)
        even.pop(tmpj)
        ans+=1
print(ans)


### FIXED CODE ###

N=int(input())
A=list(map(int, input().split()))

A.sort(reverse=True)
dic={}
for a in A:
    dic[a]=dic.get(a,0)+1

ans=0

for a in A:
    small=(1<<(len(format(a,"b")))) -a
    if small==a:
        if dic[a]>=2:
            dic[a]-=2
            ans+=1
        continue
    if dic.get(a,0)>0 and dic.get(small,0)>0:
        dic[a]-=1
        dic[small]-=1
        ans+=1
print(ans)
n = int(input())

az = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

def norm(n, in_list):
	out_list = []
	for l in in_list:
		for i in range(len(set(l))+1):
			new = l + az[i]
      		out_list.append(new)
	return out_list

line = ["a"]

for _ in range(N-1):
  line = norm(1,line)
  
for l in line:
  print(l)


### FIXED CODE ###

N = int(input())
az = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
def norm(n, in_list):
	out_list = []
	for line in in_list:
		for i in range(len(set(line))+1):
			new_line = line + az[i]
			out_list.append(new_line)
	return out_list
init_line = ['a']
for _ in range(N-1):
	init_line = norm(1, init_line)
for line in init_line:
	print(line)
import collections

import math

n = int(input())
balls = [tuple(map(int, input().split())) for _ in range(n)]


def katamuki(balla, ballb):
    xa, ya = balla
    xb, yb = ballb
    x, y = (xa - xb), (ya - yb)
    dir = math.sqrt(y ** 2 + x ** 2)
    if x == 0:
        return 1.0, dir
    if y == 0:
        return 0.0, dir
    if y / x == -1.0:
        return 1.0, dir
    return y / x, dir


a = []
for i in range(0, n - 1):
    for j in range(i + 1, n):
        a.append(katamuki(balls[i], balls[j]))

counts = collections.Counter(a)
print(n - max(counts.values()))


### FIXED CODE ###

import collections


def calc(balla, ballb):
    xa, ya = balla
    xb, yb = ballb
    return xa - xb, ya - yb


n = int(input())
balls = [tuple(map(int, input().split())) for _ in range(n)]

if n == 1:
    print(1)
    exit()

a = []
for i in range(0, n - 1):
    for j in range(i + 1, n):
        tmp = calc(balls[i], balls[j])
        a += [tmp, tuple(-i for i in tmp)]
counts = collections.Counter(a)

print(n - max(counts.values()))
num_list = input()
key = 'keyence'

i = 0
ans =False
while num_list[i]==key[i] and i<100:
    i+=1
n = i

i = -1
while num_list[i]==key[i] and i>-100:
    i -= 1
    n += 1

if n >= 6:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

num_list = input()
key = 'keyence'
i = 0
l = len(num_list)

n = 0

while num_list[i]==key[i]:
    i+=1
    n +=1
    if n==7:
        print('YES')
        exit()

i = -1
while num_list[i]==key[i]:
    n += 1
    i -= 1
    if n==7:
        print('YES')
        exit()
print('NO')
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

a,b,c,d,e,f = inm()
s = [False]*3001
for i in range(3001):
    for j in range(1501):
        k = c*i+d*j
        if k<=f:
            s[k] = True
w = [False]*32
for i in range(31):
    for j in range(16):
        k = a*i+b*j
        if 100*k<=f:
            w[k] = True
mx = 0.0
for t in range(f-99):  # sugar gram
    if not s[t]:
        continue
    ww = t/e  # ww = ax+by must be this much
    for z in range(f//100 + 1, 0,-1):  # water/100
        if not w[z] or z*100+t>f:
            continue
        if z<ww:
            break
        r = t/(100*z+t)
        if r>mx:
            mx = r
            mxs = t
            mxsw = t+100*z
print("{} {}".format(mxsw,mxs))


### FIXED CODE ###

from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

a,b,c,d,e,f = inm()
s = [False]*3001
for i in range(3001):
    for j in range(1501):
        k = c*i+d*j
        if k<=f:
            s[k] = True
w = [False]*32
for i in range(31):
    for j in range(16):
        k = a*i+b*j
        if 100*k<=f:
            w[k] = True
mx = 0.0
mxs = 0
mxsw = 100*a
for t in range(f-99):  # sugar gram
    if not s[t]:
        continue
    ww = t/e  # ww = ax+by must be this much
    for z in range(f//100 + 1, 0,-1):  # water/100
        if not w[z] or z*100+t>f:
            continue
        if z<ww:
            break
        r = t/(100*z+t)
        if r>mx:
            mx = r
            mxs = t
            mxsw = t+100*z
print("{} {}".format(mxsw,mxs))
A, B, C, D = map(int,input().split()
import fractions
lcm = C*D//fractions.gcd(C,D)
print((B-B//C-B//D+ B//lcm)-((A-1) - (A-1)//C - (A-1)//D + (A-1)//lcm))

### FIXED CODE ###

A, B, C, D = map(int,input().split())
import fractions
lcm = C*D//fractions.gcd(C,D)
print((B-B//C-B//D+ B//lcm)-((A-1) - (A-1)//C - (A-1)//D + (A-1)//lcm))
def main():
    n = input()
    print(f'ABC{n}')

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = input()
    print('ABC%s' % n)

if __name__ == '__main__':
    main()
N,X = map(int,input().split())
L = list(map(int,input().split()))
d = 0
ans = 1
for i in range(1,N+2):
  d += L[i-1]
  if d <= X:
    ans += 1
  else:
    break
print(ans)

### FIXED CODE ###

N,X = map(int,input().split())
L = list(map(int,input().split()))
d = 0
ans = 1
for i in range(1,N+1):
  d += L[i-1]
  if d <= X:
  	ans += 1
print(ans)
import math

def nCr(n,r):
    f = math.factorial
    return int(f(n) / f(r) / f(n-r))

def nHk(n, k):
    f = math.factorial
    return int(f(n + k - 1) // f(k) // f(n - 1))

N, K = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(1, K + 1):
#    print('i: ' + str(i))
    # 青玉をi個のグループに並べる並べ方
    blue = 1
#    if i == 1:
#        blue = 1
#    else:
#        blue = nCr(K - 1, i - 1)
#    print('blue: ' + str(blue))
    # 青い玉に合わせた赤い玉の並べ方
    if (N - K) < (i - 1):
        red = 0
#        print('red0: ' + str(red))
    elif i == 1:
        red = (N - K) + 1
#        print('red1: ' + str(red))
    else:
        red = nCr(K - 1, i - 1) * nHk(i + 1, N - K - (i - 1))
#        print('nCr: ' + str(nCr(K - 1, i - 1)))
#        print('nHk: ' + str(nHk(i + 1, N - K - (i - 1))))
#        print('red2: ' + str(red))

    # 解は青の並べ方と赤の並べ方の組み合わせ
    ans = blue * red % MOD
    print(ans)
#    print('ans: ' + str(ans))


### FIXED CODE ###

from operator import mul
from functools import reduce

def nCr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N, K = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(1, K + 1):
    if i > N - K + 1:
        ans = 0
    else:
        ans = nCr(K - 1, i - 1) * nCr(N - K + 1, i) % MOD
    print(ans)
a=int(input())
b=int(input())

print(a-b+1)

### FIXED CODE ###

l=list(map(int,input().split()))
print(l[0]-l[1]+1)
n=int(input())
d=dict()
for i in map(int,input().split()):
  if i not in d:
    d[i]=1
  else:
    d[i]+=1
ans=[]
for i in d.keys():
  for _ in range(d[i]//2):
    ans.append(i)
ans.sort(reverse=1)
print(ans[0]*ans[1])

### FIXED CODE ###

n=int(input())
d=dict()
for i in map(int,input().split()):
  if i not in d:
    d[i]=1
  else:
    d[i]+=1
ans=[0,0]
for i in d.keys():
  for _ in range(d[i]//2):
    ans.append(i)
ans.sort(reverse=1)
print(ans[0]*ans[1])
import sys

x = sys.argv[1]
y = sys.argv[2]

a_to_b = int(x)
b_to_c = int(y) / 2

print(a_to_b + b_to_c)

### FIXED CODE ###

x, y = map(int, input().split())

print(x + y//2)
N = int(input())
A = list(map(int,input().split()))
#res = A[0]
for i in range(1,N): 
	A[0] *= A[i]
if A[0] <= 10**18:
	print(A[0])
else:
	print("-1")


### FIXED CODE ###

A = input().split()
print(int(A[0])*int(A[1]))
s=input()
n=s[::2].count("0")+s[1::2].count("1")
print(min(n,lens(s)-n))

### FIXED CODE ###

s=input()
n=s[::2].count("0")+s[1::2].count("1")
print(min(n,len(s)-n))
a=int(input())
s=int(input())
if a>=3200:
  print(s)
else:
  print('red')

### FIXED CODE ###

a=int(input())
s=str(input())
if a>=3200:
    print(s)
else:
    print('red')
n = int(input())

linked_list = []

for _ in range(n):
    command = input()

    if "insert" in command:
        x = command.split()[-1]
        linked_list.insert(0, x)
    elif command == "deleteFirst":
        del linked_list[0]
    elif command == "deleteLast":
        del linked_list[-1]
    elif "delete" in command:
        x = command.split()[-1]
        del linked_list[linked_list.index(x)]

print(*linked_list)



### FIXED CODE ###

from collections import deque

n = int(input())

linked_list = deque([])

for _ in range(n):
    command = input()

    if "insert" in command:
        x = command.split()[-1]
        linked_list.appendleft(x)
    elif command == "deleteFirst":
        linked_list.popleft()
    elif command == "deleteLast":
        linked_list.pop()
    elif "delete" in command:
        x = command.split()[-1]
        if x in linked_list:
            linked_list.remove(x)

print(*linked_list)
N = int(input())
S = input()

ans = 0

# 2文字以上
for i in range(0, N - 3):
    for j in range(i + 2, N):
        if S[i:i + 1] == S[j:j + 1]:
            length, max_length = 2, j
            i, j = i + 1, j + 1
            while True:
                if i + 1 == max_length or j + 1 == N:
                    break
                else:
                    print(i, j)
                    i, j = i + 1, j + 1
                    print(i, j)
                    if S[i] == S[j]:
                        length += 1
                    else:
                        break
            if length > ans:
                ans = length

# 1文字
if ans == 0:
    for i in range(N - 1):
        s = S[i]
        if s in S[i + 1:]:
            ans = 1

print(ans)


### FIXED CODE ###

N = int(input())
S = input()

ans = 0
left, right = 0, 1
while right < N:
    s = S[left:right]
    if s in S[right:]:
        ans = max(ans, len(s))
        right += 1
    else:
        left += 1

print(ans)
import math
N = int(input())
vals = [1]

tmp = 6
while tmp <= 100000:
  vals.append(tmp)
  tmp *= 6

tmp = 9
while tmp <= 100000:
  vals.append(tmp)
  tmp *= 9

vals.sort()

dp = [0] + [float('inf')] * N
for n in range(1, N+1):
  i = 0
  while vals[i] <= n:
    dp[n] = min(dp[n], dp[n-vals[i]]+1)
    i += 1

print(dp[N])

### FIXED CODE ###

N = int(input())
vals = [1]

tmp = 6
while tmp <= 100000:
  vals.append(tmp)
  tmp *= 6

tmp = 9
while tmp <= 100000:
  vals.append(tmp)
  tmp *= 9

vals.sort()

dp = [0] + [float('inf')] * N
for n in range(1, N+1):
  i = 0
  while i < len(vals) and vals[i] <= n:
    dp[n] = min(dp[n], dp[n-vals[i]]+1)
    i += 1

print(dp[N])
X = int(input())

AA = 0
BB = 0

for A in range(200):
    for B in range(200):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

if AA == 0 and BB == 0:
    for A in range(200):
        if X == (A ** 5) + 1:
            AA = A
            BB = -1

print(AA,BB)

### FIXED CODE ###

N = input()

if N == 'ARC':
    print('ABC')
else:
    print('ARC')
N = int(input())
A = map(int, input().split())
c = 0.0
for i in range(N):
  c += (1 / A[i])
print(1/c)
  

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
s = 0
for i in range(N):
  s += 1/A[i]
print(1/s)
import math

N, M = map(int, input().split())
S = input()
T = input()

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

success = False
ans = 0

_lcm = lcm(N, M)
for k in range(1, N*M//_lcm + 1):
    ans = k * _lcm
    s = [(i * ans)//N + 1 for i in range(len(S))]
    t = [(i * ans)//M + 1 for i in range(len(T))]

    pool = s + t

    double_st = [x for x in set(pool) if pool.count(x) > 1]
    isImpossible = False

    for st in double_st:
        s_i = my_index(s, st, -1)
        t_i = my_index(t, st, -1)
        if s_i == -1 or t_i == -1 or s_i >= len(S) or t_i >= len(T):
            continue
        if S[s_i] != T[t_i]:
            isImpossible = True
            
    if not isImpossible:
        success = True
        break

if not success:
    print(-1)
else:
    print(ans)

### FIXED CODE ###


N, M = map(int, input().split())
S = input()
T = input()

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
 
def lcm(x, y):
    return (x * y) // gcd(x, y)

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

success = False
fans = 0

_lcm = lcm(len(S), len(T))

def isImpble(k, _lcm):
    global success
    global S
    global T
    global fans
    
    ans = k * _lcm
    double_st = []
    
    for i in range(len(S)):
        if (len(T)*i)%len(S) == 0 and (len(T) * i)//len(S) <len(T):
            double_st += [(i * ans)//len(S) + 1]
    isImpossible = False

    for st in double_st:
        s_i = ((st-1) * len(S))//ans
        t_i = ((st-1) * len(T))//ans
        if S[s_i] != T[t_i]:
            isImpossible = True
            break

            
    if isImpossible:
        return True
    else:
        success = True
        fans = k*_lcm
        return False
        

imp = isImpble((len(S) * len(T))//_lcm, _lcm)

if not imp:
    for k in range(1, (len(S) * len(T))//_lcm ):
        imp = isImpble(k, _lcm)
        if success:
            break
    

if not success:
    print(-1)
else:
    print(fans)
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    h,w,K=map(int,input().split())
    g=[[_ for _ in input()] for _ in range(h)]
    for i in range(h):
        for j in range(w):
            if g[i][j]=='.':
                g[i][j]=0
            else:
                g[i][j]=1
    n=h+w
    cnt=0
    for i in range(2 ** n):
        gg=deepcopy(g)
        for j in range(n):
            if ((i >> j) & 1):
                if j-h<0:
                    for k in range(w):
                        gg[j][k]=2
                else:
                    for l in range(h):
                        gg[l][j-h]=2
        
        ans=0
        for i in range(h):
            for j in range(w):
                if gg[i][j]==1:
                    ans+=1

        if ans==K:
            cnt+=1
    print(cnt)


    
resolve()

### FIXED CODE ###

from copy import copy, deepcopy # pythonのみ．copyは1次元，deepcopyは多次元．
# from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
# from functools import reduce
# from heapq import heapify, heappop, heappush
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
# import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import statistics # Pythonのみ
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    h,w,K=map(int,input().split())
    g=[[_ for _ in input()] for _ in range(h)]
    for i in range(h):
        for j in range(w):
            if g[i][j]=='.':
                g[i][j]=0
            else:
                g[i][j]=1
    n=h+w
    cnt=0
    for i in range(2 ** n):
        gg=deepcopy(g)
        for j in range(n):
            if ((i >> j) & 1):
                if j-h<0:
                    for k in range(w):
                        gg[j][k]=2
                else:
                    for l in range(h):
                        gg[l][j-h]=2
        
        ans=0
        for i in range(h):
            for j in range(w):
                if gg[i][j]==1:
                    ans+=1

        if ans==K:
            cnt+=1
    print(cnt)


    
resolve()