Harryxun/stf_run huggingface dataset:
A = input()
B = input()

if A >= 13:
	print(B)
    
elif 6 <= A <= 12:
	print(B // 2)

else:
	print(0)

### FIXED CODE ###

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

if A >= 13:
	print(B)
    
elif 6 <= A <= 12:
	print(B // 2)

else:
	print(0)
import math

n, k = map(int, input().split())

def cmb(n, r):
    return math.factorial(n)// (math.factorial(n-r) * math.factorial(r))

for i in range(k):
    if i <= k:
        print(cmb(n-k+1, i+1) * cmb(k-1, i) % 1000000007)
    else:
        print(0)

### FIXED CODE ###

import math

n, k = map(int, input().split())

def cmb(n, r):
    return math.factorial(n)// (math.factorial(n-r) * math.factorial(r))

for i in range(k):
    if i <= n-k:
        print(cmb(n-k+1, i+1) * cmb(k-1, i) % 1000000007)
    else:
        print(0)
N = int(input())

count = 0

for i in range(N +1):
    k, t = map(int, input().split())
    if count == 3:
      print ( "yes" )
      count += 5
      break
      
    if not k == t:
        count *= 0
    if k == t:
       count += 1 
       
      
if not count >= 3:
  print ("no")



### FIXED CODE ###

N = int(input())

count = 0

for i in range(N):
    k, t = map(int, input().split())
      
    if not k == t:
        count *= 0
    if k == t:
       count += 1 
    if count == 3:
      print ( "Yes" )
     
      break
        
if count == 3:
        print ("")
else:
  print ("No")
import sys

def f(x):
    p=0
    cnt=0
    for i in range(n-1,-1,-1):
        while p<n and a[i]+a[p]<x:
            p+=1
        cnt+=n-p
    return cnt

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()

l,r=a[0]*2,a[n-1]*2

while r-l>0:
    if r-l<=1:
        if f(r)==m: md=r;break 
        else: md=l;break
    md=(r+l)//2
    k=f(md)
    if k==m: break
    elif k>m: l=md
    else: r=md


p=0
cnt=0
ans=0

for q in range(n-1,-1,-1):
    try:
        while p<n and q>-1:
            if a[q]+a[p]<=md: p+=1
            else: break
    except IndexError:
        b=0
        while True:
            b+=0

    cnt+=n-p
    ans+=a[q]*(n-p)*2
    if p==n: break


ans+=(m-cnt)*md
print(ans)


### FIXED CODE ###

import sys

def f(x):
    p=0
    cnt=0
    for i in range(n-1,-1,-1):
        while p<n and a[i]+a[p]<x:
            p+=1
        cnt+=n-p
    return cnt

n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort()

l,r=a[0]*2,a[n-1]*2
md=(r+l)//2
while r-l>0:
    if r-l<=1:
        if f(r)==m: md=r;break 
        else: md=l;break
    md=(r+l)//2
    k=f(md)
    if k==m: break
    elif k>m: l=md
    else: r=md

p=0
cnt=0
ans=0

for q in range(n-1,-1,-1):
    try:
        while p<n and a[q]+a[p]<=md:
            p+=1
    except:
        b=1
        while True:
            b+=1

    if p==n: break
    cnt+=n-p
    ans+=a[q]*(n-p)*2


ans+=(m-cnt)*md
print(ans)
import bisect

def main():
    N = int(input())
    CSF = tuple(tuple(map(int, input().split())) for _ in [0] * (N - 1))

    start = [[] for _ in [0] * N]
    for i, (c, s, f) in enumerate(CSF):
        arrival = s + c + 1
        start[i] = [j for j in range(s, arrival, f)]

    for i in range(N - 1):
        sec = 0
        for j in range(i, N - 1):
            n = bisect.bisect_left(start[j], sec)
            sec = start[j][n] + CSF[j][0]
        print(sec)
    print(0)

main()


### FIXED CODE ###

def main():
    N = int(input())
    C, S, F = [], [], []
    capnd, sapnd, fapnd = C.append, S.append, F.append
    for c, s, f in (map(int, input().split()) for _ in [0] * (N - 1)):
        capnd(c)
        sapnd(s)
        fapnd(f)

    for i in range(N):
        t = 0
        for j in range(i, N - 1):
            if t < S[j]:
                t = S[j]
            elif not t % F[j]:
                pass
            else:
                t = t + F[j] - t % F[j]
            t += C[j]
        print(t)

main()
x = input()
if x >= 30:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

x = int(input())
if x >= 30:
    print('Yes')
else:
    print('No')
N = 1000000

N1 = [i for i in range(N+40)]
N2 = [i for i in range(N+40)]

#N1[0] = 0
#N2[0] = 0

p = [n*(n+1)*(n+2)//6 for n in range(1,200) if n *(n+1)*(n+2)//6< N+1]
p2 = [n*(n+1)*(n+2)//6 for n in range(1,200) if n *(n+1)*(n+2)//6< N+1 and n *(n+1)*(n+2)//6 % 2 ==1 ]
#print(p2)
for p_ in p:
    #if p_ > N +1:
     #   continue
    n = min(p_*5,N)
    for j in range(p_,n):
#        print(j)
        if N1[j] > N1[j-p_] +1:
            N1[j] = N1[j-p_]+1
"""
    if p_%2==0:
        continue
    for j in range(p_,N):
        if N2[j] >N2[j-p_]+1:
            N2[j]=N2[j-p_]+1
"""
#print("a")
for p_ in p2:
#    if p_ > N +1 :
 #       continue
    #n = min(p_*7,N+1)
    for j in range(p_,N):
        if N2[j] > N2[j-p_]+1:
            N2[j] = N2[j -p_]+1
#print('a')
"""
"""
while True:
    n = int(input())
    if n == 0:
        break
    print(N1[n],N2[n])



### FIXED CODE ###

import copy

item = [i *(i +1) * (i+2) //6 for i in range(1,181)]
q = []
while True:
    in_ = int(input())
    if in_ == 0:
        break
    q.append(in_)

INIT = 1000
MAX = max(q) +10
ans = [INIT] *MAX
ans[0] = 0
odd_item = [i for i in item if i % 2 ==0 ]
even_item = [i for i in item if not(i % 2 == 0)]

for i in even_item:
    for j in range(0,MAX-i):
        if ans[j+i] > ans[j] + 1:
            ans[j+i] = ans[j] + 1

ans_ = copy.deepcopy(ans)

for i in odd_item:
    for j in range(0,MAX-i):
        if ans[j+i] > ans[j] + 1:
            ans[j+i] = ans[j]+1
for i in q:
    print(ans[i],ans_[i])
import numpy as np

n = int(input())
x = list(map(int, input().split()))
p = round(sum(x) / len(x))
x_arr = np.array(x)
print(sum((x_arr - p) ** 2))

### FIXED CODE ###

import numpy as np

n = int(input())
x = list(map(int, input().split()))
p = round(sum(x) / len(x))
x_arr = np.array(x)
print(sum((x_arr - p) ** 2))
n=int(input())
s=input()
k=int(input())
r=s[k]
ans=""
for i in range(n):
  if s[i]==r:
    ans+=r
  else:
    ans+="*"
print(ans)

### FIXED CODE ###

n=int(input())
s=input()
k=int(input())
r=s[k-1]
ans=""
for i in range(n):
  if s[i]==r:
    ans+=r
  else:
    ans+="*"
print(ans)
chars = input()

ans = []
for c in chars:
    if c in ['0','1']:
        ans.append(c)
    elif len(ans) != 0:
        ans.pop(-1)
        
        
p;rint(''.join(ans))




### FIXED CODE ###

s = list(input())

S = []
for i in range(len(s)):
    if s[i] == "0":
        S += s[i]
    elif s[i] == "1":
        S += s[i]
    elif len(S) == 0:
        pass
    else:
        del S[-1]
print("".join(S))
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]

    N,M = LI()

    d = {}
    m = M
    for i in range(2,int(math.sqrt(M))+1):
        while m % i == 0:
            if i in d:
                d[i] += 1
            else:
                d[i] = 1
            m //= i
    if m > 1:
        d[m] = 1

    a = [0]
    b = [0]
    c = 1
    for i in range(1,N+(int(math.log(N,2))+2)**2 +1):
        c = (c * i) % MOD
        a.append(c)
        b.append(pow(c,MOD-2,MOD))

    ans = 1
    for v in d.values():
        ans = (ans * a[N+v-1] * b[v]* b[N-1]) % MOD
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]

    N,M = LI()

    d = {}
    m = M
    for i in range(2,int(math.sqrt(M))+1):
        while m % i == 0:
            if i in d:
                d[i] += 1
            else:
                d[i] = 1
            m //= i
    if m > 1:
        d[m] = 1

    a = [1]
    b = [1]
    c = 1
    for i in range(1,N+int(math.log(M,2)) +1):
        c = (c * i) % MOD
        a.append(c)
        b.append(pow(c,MOD-2,MOD))

    ans = 1
    for v in d.values():
        ans = (ans * a[N+v-1] * b[v]* b[N-1]) % MOD
    print(ans)

if __name__ == '__main__':
    main()
N = int(input())
ans = sum(N[:N-1])N = int(input())
ans = round((N-1)*N/2)
print(ans)

### FIXED CODE ###

N = int(input())
ans = (N-1)*N//2
print(ans)
inputs = input()

a = inputs

ans = 0
while len(a) > 1:
    if a[0] == a[-1]:
        a = a[1:-1]
    if a[0] == 'x' and a[-1] != 'x':
        ans += 1
        a += 'x'
    if a[0] != 'x' and a[-1] == 'x':
        ans += 1
        a = 'x' + a
    if a[0] != a[-1]:
        ans = -1
        break
        
print(ans)

### FIXED CODE ###

inputs = input()

a = inputs

ans = 0
while len(a) > 1:
    if a[0] == a[-1]:
        a = a[1:-1]
    elif a[0] == 'x' and a[-1] != 'x':
        ans += 1
        a += 'x'
    elif a[0] != 'x' and a[-1] == 'x':
        ans += 1
        a = 'x' + a
    elif a[0] != a[-1]:
        ans = -1
        break
        
print(ans)
YOUBI = input()
if YOUBI == "MON":
  print"6"
if YOUBI == "TUE":
  print"5"
if YOUBI == "WED":
  print"4"
if YOUBI == "THU":
  print"3"
if YOUBI == "FRI":
  print"2" 
if YOUBI == "SAT":
  print"1"
if YOUBI == "SUN":
   print"7"
    
    
    SUN,MON,TUE,WED,THU,FRI,SAT

### FIXED CODE ###

YOUBI = input()
if YOUBI == "MON":
  print(6)
if YOUBI == "TUE":
  print(5)
if YOUBI == "WED":
  print(4)
if YOUBI == "THU":
  print(3)
if YOUBI == "FRI":
  print(2) 
if YOUBI == "SAT":
  print(1)
if YOUBI == "SUN":
   print(7)
N, K = map(int, input().split())
A = []
s = [0] * 200000
for i in range(K):
  a_k = int(input())
  s[i+1] = s[i] + a_k

max_s = 0
for i in range(K)
  if max_s < s[i+K] - s[i]:
    max_s = s[i+K] - s[i]
print(max_s)

### FIXED CODE ###

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)
inputted = list(map(int, input().split()))
K = int(input())
X = int(input())

total = 500 * K;
answer = 'Yes' if total >= X else 'No';

print(answer);


### FIXED CODE ###

inputted = list(map(int, input().split()))
K = inputted[0]
X = inputted[1]

total = 500 * K;
answer = 'Yes' if total >= X else 'No';

print(answer);
N, M = map(int, input().split())

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 998244353
n = 10**6
g1 = [1, 1]
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = cmb(M*3+N-1, N-1, mod)
for i in range(M*2+1, M*3+1):
    ans -= cmb(M*3-i+(N-1)-1, N-2, mod) * N - mod*mod
    ans = (ans+mod)%mod

for i in range(M+1, min(N, 3*M)+1):
    if (3*M - i) % 2 == 0:
        two = (3*M - i) // 2
        ans -= cmb(two+N-1, N-1, mod) * cmb(N, i, mod) - mod*mod
        ans = (ans+mod)%mod
print(ans)


### FIXED CODE ###

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

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 998244353
n = 10**6*3
g1 = [1, 1]
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = cmb(M*3+N-1, N-1, mod)
for i in range(M*2+1, M*3+1):
    ans -= cmb(M*3-i+(N-1)-1, N-2, mod) * N - mod*mod
    ans = (ans+mod)%mod

for i in range(M+1, min(N, 3*M)+1):
    if (3*M - i) % 2 == 0:
        two = (3*M - i) // 2
        ans -= cmb(two+N-1, N-1, mod) * cmb(N, i, mod) - mod*mod
        ans = (ans+mod)%mod
print(ans)
import sys
sys.setrecursionlimit(10000000)


def process():
    data = []
    for line in get_data():
        line = line.split()
        if len(line) == 2:
            if line[0] == line[1] == '0':
                data = []
                continue
            H = int(line[0])
            W = int(line[1])
        elif len(line) == 0:
            pass
        else:
            data.append(line[0])
            if len(data) == H:
                field = create_field(H, W)
                print search(H, W, data, field)


def search(H, W, data, field):
    count = 0
    for i in xrange(H):
        for j in xrange(W):
            if field[i][j] == 0:
                continue
            _search(i, j, H, W, data[i][j], data, field)
            count += 1
    return count


def _search(i, j, H, W, cell, data, field):
    field[i][j] = 0
    for a in xrange(i-1, i+2):
        if -1 < a < H:
            pass
        else:
            continue
        for b in xrange(j-1, j+2):
            if -1 < b < W:
                pass
            else:
                continue

            if a != i and b != j:
                continue

            if field[a][b] == 0:
                continue
            if cell == data[a][b]:
                _search(a, b, H, W, cell, data, field)
    return


def create_field(H, W):
    field = []
    for i in xrange(H):
        raw = []
        for j in xrange(W):
            raw.append(1)
        field.append(raw)
    return field


def get_data():
    return [line.strip() for line in raw_input()]


process()

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)


def main():
    solve()


def solve():
    for data in get_dataset():
        print search(data)


def search(data):
    count = 0
    H = len(data)
    W = len(data[0])
    for i in xrange(H):
        for j in xrange(W):
            if data[i][j] == '.':
                continue
            _search(i, j, H, W, data[i][j], data)
            count += 1
    return count


def _search(i, j, H, W, cell, data):
    data[i][j] = '.'
    for a in xrange(i-1, i+2):
        if not -1 < a < H:
            continue
        for b in xrange(j-1, j+2):
            if not -1 < b < W:
                continue

            if a != i and b != j:
                continue

            if data[a][b] == '.':
                continue

            if cell == data[a][b]:
                _search(a, b, H, W, cell, data)
    return


def get_dataset():
    dataset = []
    while True:
        line = raw_input().rstrip().split()
        H = int(line[0])
        if H == 0:
            break

        data = []
        for i in xrange(H):
            data.append(list(raw_input().rstrip()))
        dataset.append(data)
    return dataset


if __name__ == '__main__':
    main()
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
kinds=0
j1=0 #Bのインデックス
while B[j1]<A[0]:
  j1+=1
k1=0
while C[k1]<B[j1]:
  k1+=1
for i in range(N):
  for j in range(j1,N):
    if A[i]<B[j]:
      for k in range(k1,N):
        if B[j]<C[k]:
          kinds+=1
print(kinds)

### FIXED CODE ###

import bisect
point=0
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
for i in range(N):
  m=bisect.bisect_left(A,B[i])
  n=bisect.bisect_right(C,B[i])
  point+=m*(N-n)
print(point)
from itertools import permutations
import copy

def dis(po1,po2):
  return(abs(po1[0]-po2[0])+abs(po1[1]-po2[1]))

def print_process(min_prm):
  for i in range(0,len(min_prm)//2+1,2):
    while prm[i][0] != prm[i+1][0]:
      prv_prm = copy.deepcopy(prm[i])
      if prm[i][0] < prm[i+1][0]: prm[i][0] += 1
      else: prm[i][0] -= 1
      print(prv_prm[1], prv_prm[0], prm[1], prm[0])
   
    while prm[i][1] != prm[i+1][1]:
      prv_prm = copy.deepcopy(prm[i])
      if prm[i][1] < prm[i+1][1]: prm[i][1] += 1
      else: prm[i][1] -= 1
      print(prv_prm[1], prv_prm[0], prm[1], prm[0])

H,W = map(int,input().split())
odds = []
for j in range(H):
  for i, a in enumerate(map(int,input().split())):
    if a%2 == 1:
      odds.append([i+1,j+1])

min_prm = None
min_dis = float('inf')
for prm in permutations(odds):
  tmp_dis = 0
  for i in range(0,len(prm)//2+1,2):
    tmp_dis += dis(prm[i],prm[i+1])
  
  if min_dis > tmp_dis:
    min_prm = prm
    min_dis = tmp_dis
print(min_dis)
print_process(min_prm)

### FIXED CODE ###

H,W = map(int,input().split())
A = [[0 for _ in range(W+1)]]
sumA = 0
for _ in range(H):
  row = [0] + list(map(int,input().split())) 
  A.append(row)
  sumA = sum(row)



c_num = 0
pros = []
for j in range(1,H+1):
  for i in range(1,W):
    if A[j][i]%2==1:
      pros.append([j,i, j,i+1])
      c_num += 1
      A[j][i] -= 1
      A[j][i+1] += 1
 
for j in range(H,1,-1):
  if A[j][W]%2==1:
    pros.append([j,W,j-1,W])
    c_num += 1
    A[j][W] -= 1
    A[j-1][W] += 1

print(c_num)
[print(*pro) for pro in pros]
N,M=map(int,input().split())
mod=10**9+7
a=[]
for i in range(M):
    a.append(int(input()))


DP=[1]*(N+1)

if 1 in a:
    DP[1]=0

for i in range(2,N+1):
    if i in a:
        DP[i]=0
        if DP[i-1]==0:
            print(0)
            exit()
    else:
        DP[i]=DP[i-1]+DP[i-2]
        DP[i]=DP[i]%mod

print(DP[N])


### FIXED CODE ###

import collections

N=int(input())
A_data=list(map(int,input().split()))
mod=10**9+7

A=collections.Counter(A_data)

f=True
if N%2==1:
    if not A[0]==1:
        ans=0
    else:
        for i in range(2,N,2):
            if not A[i]==2:
                ans=0
                f=False
                break
        if f==True:
            ans=2**((N-1)//2)%mod
elif N%2==0:
    for i in range(1,N,2):
        if not A[i]==2:
            ans=0
            f=False
            break
    if f==True:
        ans=2**(N//2)%mod

print(ans)
N=int(input())
H=list(map(int,input().split()))

countlist=[]
count=0

for i in range(N-1):
  if  H[i]>=H[i+1]:
    count+=1
  else:
    countlist.append(count)
    count=0
else:
  countlist.apend(count)

print(max(countlist))

### FIXED CODE ###

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

count_list = []
count = 0

for i in range(N-1):
  if H[i] >= H[i+1]:
    count += 1
  else:
    count_list.append(count)
    count = 0
else:
  count_list.append(count)
    
print(max(count_list))
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int,stdin.readline().rstrip().split()))
b = list(map(int,stdin.readline().rstrip().split()))

pra = []
mai = []
kosuu = 0
for i in range(n):
    if a[i]-b[i] < 0:
        mai.append(b[i]-a[i])
        continue
    elif a[i]-b[i] > 0:
        pra.append(a[i]-b[i])
    kosuu += 1

pra.sort(reverse=True)

if sum(pra) < sum(mai):
    print(-1)
    exit()

if kosuu == n:
    print(0)
    exit()

count = 1
now = 0
while mai:
    if pra[now] < mai[0]:
        count += 1
        now += 1
        continue
    else:
        pra[now] -= mai[0]
        count += 1
    mai.pop(0)
print(count)

### FIXED CODE ###

from sys import stdin
from itertools import accumulate
import bisect

n = int(stdin.readline().rstrip())
a = list(map(int,stdin.readline().rstrip().split()))
b = list(map(int,stdin.readline().rstrip().split()))

pra = []
mai = 0
kosuu = 0
atari = 0

for i in range(n):
    if a[i]-b[i] < 0:
        mai += b[i]-a[i]
        kosuu += 1
        continue
    elif a[i]-b[i] > 0:
        pra.append(a[i]-b[i])
    atari += 1

if sum(pra) < mai:
    print(-1)
    exit()
if atari == n:
    print(0)
    exit()
pra.sort(reverse=True)

pra = list(accumulate(pra))
print(bisect.bisect(pra,mai)+kosuu+1)
a,b=map(int,input())
if a<10:
  print(b+(100*(10-a)))
else:
  print(b)

### FIXED CODE ###

a,b=map(int,input().split())
if a<10:
  print(b+(100*(10-a)))
else:
  print(b)
string = input()
    Capital = string[0]
    print("A" + Capital + "C")



### FIXED CODE ###

def iroha():
    head, string, heel = map(str, input().split())
    headC = head[0]
    Capital = string[0]
    heelC = heel[0]
    print(headC + Capital + heelC)

if __name__ == "__main__":
    iroha()
import math
from functools import reduce

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

p = 10**9+7

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(A)

B = [lcm//i for i in A]

print(sum(B))

### FIXED CODE ###

import fractions
from functools import reduce

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

p = 10**9+7

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(A)

B = [lcm//i for i in A]

print(sum(B)%p)
W,H,N = map(int,input().split())
limit = {'top': H, 'right': W, 'down': 0, 'left': 0}
for _ in range(N):
  x,y,a = map(int.input().split())
  if a == 1:
    if x > limit['left']:
      limit['left'] = x
  elif a == 2:
    if x < limit['right']:
      limit['right'] = x
  elif a == 3:
    if y > limit['down']:
      limit['down'] = y
  elif a == 4:
    if y < limit['top']:
      limit['top'] = y
height = limit['top'] - limit['down']
width = limit['right'] - limit['left']
if (height > 0) and (width > 0):
  print(height * width)
else:
  print(0)
  

### FIXED CODE ###

W,H,N = map(int,input().split())
limit = {'top': H, 'right': W, 'down': 0, 'left': 0}
for _ in range(N):
  x,y,a = map(int,input().split())
  if a == 1:
    if x > limit['left']:
      limit['left'] = x
  elif a == 2:
    if x < limit['right']:
      limit['right'] = x
  elif a == 3:
    if y > limit['down']:
      limit['down'] = y
  elif a == 4:
    if y < limit['top']:
      limit['top'] = y
height = limit['top'] - limit['down']
width = limit['right'] - limit['left']
if (height > 0) and (width > 0):
  print(height * width)
else:
  print(0)
#
def happiness(s):
    h = 0
    c = s[0]
    for i in range(1,len(s)):
        if s[i] == c:
            h = h + 1
        else:
            c = s[i]
    return h

def schrun(s,l):
    c = s[l]
    i = l+1
    while (i<len(s)) and (s[i] == c) :
        i = i+1
    return i
        
#
n, k = map(int, input().split())
s = input()
#
h = happiness(s)
i = 0
l = 0
while( (i<k) and (l<n) ):
    l = schrun(s,l)
    r = schrun(s,l)-1
    if r == n-1:
        h = h + 1
    else:
        h = h + 2
    i = i + 1
    l = r + 1

print(h)


### FIXED CODE ###

#

def happiness(s):
    h = 0
    c = s[0]
    for i in range(1,len(s)):
        if s[i] == c:
            h = h + 1
        else:
            c = s[i]
    return h

def schrun(s,l):
    c = s[l]
    i = l+1
    while (i<len(s)) and (s[i] == c) :
        i = i+1
    return i
        
#
n, k = map(int, input().split())
s = input()
#
h = happiness(s)
i = 0
l = 0
while( (i<k) and (l<n) and (h<n-1)):
    l = schrun(s,l)
    r = schrun(s,l)-1
    if r == n-1:
        h = h + 1
    else:
        h = h + 2
    i = i + 1
    l = r + 1

print(h)