Harryxun/stf_run huggingface dataset:
N , M , X = map(int,input().split())
C = []
A = []
for _ in range(N):
    CA = list(map(int,input().split()))
    C.append(CA[0])
    A.append(CA[1:])

ans = float('inf')
for i in range(2**N):
    Level = [0]* M
    Cost = 0
    
    for j in range(N):
        if (i>>j)&1:
            Cost += C[j]
            for k in range(M):
                Level[​ Cost)

if ans != float('inf'):
    print(ans)
else:
    print('-1')

### FIXED CODE ###

N , M , X = map(int,input().split())
C = []
A = []
for _ in range(N):
    CA = list(map(int,input().split()))
    C.append(CA[0])
    A.append(CA[1:])

ans = float('inf')
for i in range(2**N):
    Level = [0]* M
    Cost = 0
    
    for j in range(N):
        if (i>>j)&1:
            Cost += C[j]
            for k in range(M):
                Level[k] += A[j][k]
                
    if all([Level[l] >= X for l in range(M)]):
        ans = min(ans, Cost)

if ans != float('inf'):
    print(ans)
else:
    print('-1')
from collections import Counter

def main():
    N,P = map(int,input().split())
    S = input()[::-1]
    ans = 0
    if P == 2 or P == 5:
        for i,s in enumerate(S):
            if int(s) % P == 0:
                ans += N-i
    else:
        D = [0] * (N+1)
        for i in range(N):
            D[i] =  int(S[:i+1][::-1]) % P
        C = Counter(D)
        ans = sum([max(c*(c-1)//2 for c in C.values()])
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    N,P = map(int,input().split())
    S = input()[::-1]
    ans = 0
    if P == 2 or P == 5:
        for i,s in enumerate(S):
            if int(s) % P == 0:
                ans += N - i
    else:
        mods = [0] * P
        mods[0] = 1
        current = 0
        x = 1
        for s in S:
            current = (current + x * int(s)) % P
            ans += mods[current % P]
            mods[current % P] += 1
            x = x * 10 % P
    print(ans)

if __name__ == '__main__':
    main()
import sys
N, K = map(int,input().split())
A = list(map(int, input().split()))
if N == K:
    print(1)
    sys.exit()
idx = A.index(1)
res = 0
if idx <= K:
    idx = K-1
    res = 1
else:
    while(True):
        res += 1
        idx -= K - 1
        if idx <= 0:
            break
idx = A.index(1)
if idx <= K:
    idx = K-1
while(True):
    if idx >= N-1:
        break
    res += 1
    idx += K-1

print(res)


### FIXED CODE ###

s = input()
res = 0
for letter in s:
    if letter =='+':
        res += 1
    else:
        res -= 1
print(res)
try:
  s,w=map(int,input().split())
  if(w>=s):
    print("unsafe")
   else:
    print("safe")
except:
  pass

### FIXED CODE ###

s, w = map(int, input().split())
if w >= s:
  print('unsafe')
else:
  print('safe')
ae = [int(input()) for _ in range(5)]

nxt_time = [0]*n
for i in range(n):
    if ae[i] % 10 == 0:
        nxt_time[i] = ae[i]
    else:
        nxt_time[i] = ae[i] - ae[i] % 10 + 10
    # nxt_time[i] = (ae[i]+9) // 10 * 10
best_time = 99999999
for i in range(n):
    sumtime = 0
    for j in range(n):
        if i == j:
            sumtime += ae[i]
        else:
            sumtime += nxt_time[i]
    
    best_time = min(best_time, sumtime)

print(best_time)

### FIXED CODE ###

ae = [int(input()) for _ in range(5)]

sum_ae = 0
g = 9
cnt = 0  
for i in ae:
    if i % 10 != 0:
        g = min(g, i % 10)
        sum_ae += (i//10 + 1) * 10
        cnt += 1
    else:
        sum_ae += i
if cnt != 0:
    print(sum_ae - (10-g))
else:
    print(sum_ae)
import sys

def my_index(l, x):
    if x in l:
        return l.index(x)
    else:
        return -1

input = sys.stdin.readline
n,m = map(int, input().split())
A = list(map(int,input().split()))
d = [list(map(int,input().split())) for _ in range(m)]

d.sort(key=lambda x:-x[1])
total = sum(A)
heapq.heapify(A)

for i in range(m):
    for j in range(d[i][0]):
        tmp = heapq.heappushpop(A, d[i][1])
        if tmp < d[i][1]:
                total += (d[i][1] - tmp)
            else:
                break

print(total)


### FIXED CODE ###

import sys
import heapq

input = sys.stdin.readline
n,m = map(int, input().split())
A = list(map(int,input().split()))
d = [list(map(int,input().split())) for _ in range(m)]

d.sort(key=lambda x:-x[1])
total = sum(A)
heapq.heapify(A)

for i in range(m):
    for j in range(d[i][0]):
        tmp = heapq.heappushpop(A, d[i][1])
        if tmp < d[i][1]:
                total += (d[i][1] - tmp)
        else:
            break

print(total)
# -*- coding: utf-8 -*-
import math
n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))

if m == 0:
    dp = [0 for _ in range(n)] #i + 1段目に登る方法の数
    dp[0] = 1
    dp[1] = 2
    for i in range(2, n):
        dp[i] = dp[i - 1] + dp[i - 2]
    print(dp[n - 1])
    exit()

tmp = 0
dp = [0 for _ in range(n)]
if 1 == a[tmp]:
    dp[0] = 0
    tmp += 1
else:
    dp[0] = 1
if n >= 2 and 2 == a[tmp]:
    dp[1] = 0
    tmp += 1
elif n >= 2 and 2 != a[tmp]:
    dp[1] = dp[0] + 1

for i in range(2, n):
    if tmp < m and i + 1 == a[tmp]:
        dp[i] = 0
        tmp += 1
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
#print(dp)
print(dp[n - 1] % (pow(10, 9) + 7))


### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))

if m == 0:
    dp = [0 for _ in range(n)] #i + 1段目に登る方法の数
    dp[0] = 1
    if n >= 2:
        dp[1] = 2
    for i in range(2, n):
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
    print(dp[n - 1])
    exit()

tmp = 0
dp = [0 for _ in range(n)]
if 1 == a[tmp]:
    dp[0] = 0
    tmp += 1
else:
    dp[0] = 1
if n >= 2 and tmp < m and 2 == a[tmp]:
    dp[1] = 0
    tmp += 1
elif n >= 2 and (tmp >= m or 2 != a[tmp]):
    dp[1] = dp[0] + 1

for i in range(2, n):
    if tmp < m and i + 1 == a[tmp]:
        dp[i] = 0
        tmp += 1
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % (pow(10, 9) + 7)
#print(dp)
print(dp[n - 1] % (pow(10, 9) + 7))
n = int(input())
lie = input()
li = list(lie)
cnt = 0
for i in range(len(li)):
    if li[i] == "A" and li[i+1] == "B" and li[i+2] == "C":
        cnt += 1
    else:
        pass
print(cnt)

### FIXED CODE ###

n = int(input())
lie = input()
li = list(lie)
cnt = 0
for i in range(len(li) - 2):
    if li[i] == "A" and li[i+1] == "B" and li[i+2] == "C":
        cnt += 1
    else:
        pass
print(cnt)
S = input()
a = ""
stock = ""
data = []

for i in S:
    a = a + i
    if a != stock:
        stock = a
        data.append(a)
        a = ""
count = len(data)


if a == stock:
    i = 1
    data.append(a)
    while True:
        word = ""
        a = ""
        stock2 = ""
        data2 = []
        for j in range(i+1):
            word = word + data[j-2]
        
        for j in reversed(word):
            a = j + a
            if a != stock2:
                stock2 = a
                data2.insert(0,a)
                a = ""
        if (data2[0] != data[-(i+2)]) and (a == ""):
            count = len(data) - (i+1) + len(data2)
            break
        i += 1
        

print(count)

### FIXED CODE ###

S = input()
a = ""
stock = ""
data = []

for i in S:
    a = a + i
    if a != stock:
        stock = a
        data.append(a)
        a = ""
count = len(data)


if a == stock:
    i = 1
    data.append(a)
    check = 1
    c = 0
    while True:
        word = ""
        a = ""
        c = 0
        stock2 = ""
        data2 = []
        for j in range(i+1):
            word = data[-(j+1)] + word
        
        for j in reversed(word):
            c += 1
            a = j + a
            if check > c:
                continue
            if a != stock2:
                stock2 = a
                data2.insert(0,a)
                a = ""
        if len(data2)>=2:
            if (len(S)<=i+2) and (data2[0]!=data2[1]) and (a == ""):
                count = len(data2)
                break
            elif len(S)<=i+2:
                check += 1
                if check == len(S):
                    count = 1
                    break
                continue
        elif (len(data2)==1) and (a==""):
            if S==data2[0]:
                count = 1
                break
            else:
                i += 1
                continue
        elif len(data2)==1:
            check += 1
            continue
        if (data2[0] != data[-(i+2)]) and (a == ""):
            count = len(data) - (i+1) + len(data2)
            break
        i += 1
        

print(count)
A,B,K=map(int,input().split())
ans=[0]*2

if A>=K:
  ans[0]=max(ans,A-K)
  ans[1]=B
else:
  ans[1]=B-(K-A)

print(ans[0],ans[1])

### FIXED CODE ###

A,B,K=map(int,input().split())
ans=[0]*2

if A>=K:
  ans[0]=A-K
  ans[1]=B
else:
  ans[1]=max(0,B-(K-A))

print(ans[0],ans[1])
a,b = map(int,input().split())
if op == "+":
  print(int(a+b))
else:
  print((a-b))

### FIXED CODE ###

l = list(input().split())
if l[1] == "+":
  print(int(l[0])+int(l[2]))
else:
  print(int(l[0])-int(l[2]))
N,M=map(int,input().split)
if N=M:
  print("Yes")
else:
  print("No")
 

### FIXED CODE ###

N,M=map(int,input().split())
if N==M:
  print("Yes")
else:
  print("No")
from collections import defaultdict
from math import gcd

mod = 10 ** 9 + 7

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

d = defaultdict(int)
for a, b in ab:
    # a[i]が絶対に非負になるように
    if a < 0:
        a *= -1
        b *= -1
    g = gcd(a, b)
    d[(a // g, b // g)] += 1

all = n
ans = 1
for k1, v in d.items():
    k2 = (k1[1], -k1[0])
    if k2 in d.keys():
        all -= v
        all -= d[k2]
        ans = ans * (pow(2, v, mod) + pow(2, d[k2], mod) - 1) % mod

ans = ans * pow(2, all, mod) % mod
print(ans - 1)


### FIXED CODE ###

from collections import defaultdict
from math import gcd

mod = 10 ** 9 + 7

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

d = defaultdict(int)
zero = 0
for a, b in ab:
    # zero　別処理
    if a == b == 0:
        zero += 1
        continue
    if a == 0:
        d[(0, 1)] += 1
        continue
    if b == 0:
        d[(1, 0)] += 1
        continue

    # a[i]が絶対に非負になるように
    if a < 0:
        a *= -1
        b *= -1
    g = gcd(a, b)
    d[(a // g, b // g)] += 1

all = n - zero
ans = 1
for k1, v in d.items():
    k2 = (k1[1], -k1[0])
    if k2 in d.keys():
        all -= v
        all -= d[k2]
        ans = ans * (pow(2, v, mod) + pow(2, d[k2], mod) - 1) % mod
ans = ans * pow(2, all, mod) % mod
print((ans - 1 + zero) % mod)
import sys

def check(x, y):
    if x < y:
        tmp = x
        x = y
        y = tmp

    n = x - y
    x -= 2 * n

    if x % 3 == 0:
        return True
    else:
        return False
    

# Read
line = sys.stdin.readlines()[0]
X, Y = map(int,line.split(' '))

if not check(x, y):
    print(0)
    exit(0)


### FIXED CODE ###

import sys
from math import factorial

def ncr(n, r, p): 
    # initialize numerator 
    # and denominator 
    num = den = 1 
    for i in range(r): 
        num = (num * (n - i)) % p 
        den = (den * (i + 1)) % p 
    return (num * pow(den,  
            p - 2, p)) % p 

def check(x, y):
    if (x + y) % 3 == 0:
        return True
    else:
        return False
    

# Read
line = sys.stdin.readlines()[0]
X, Y = map(int,line.split(' '))

if not check(X, Y):
    print(0)
    exit(0)

m = int(1/3 * (2*Y - X))
n = int(Y - 2 * m)

if n < 0 or m < 0:
    print(0)
else:
    print(ncr(n+m, n, 10**9+7))
n,m = (int(x) for x in input().split())
l = [0]*m
r = [0]*m

for i in range(m):
    l[i],r[i] = (int(x) for x in input().split())
j = 0
hoge = [0]*(r[0]-l[0]+1)

for i in range(l[0],r[0]+1):
    hoge[j] = i
    j += 1

for i in range(1,m):
    tmp = []
    k = 0
    for j in range(max(hoge[0],l[i]),min(hoge[-1],r[i])+1):
        tmp.append(j)
        k += 1
    hoge = tmp
print(len(hoge))

### FIXED CODE ###

n, m = (int(x) for x in input().split())
l = [0]*m
r = [0]*m
for i in range(m):
    l[i], r[i] = [int(x) for x in input().split()]
lmax = max(l)
rmin = min(r)
if rmin >= lmax:
    print(rmin-lmax+1)
else:
    print(0)
a , b, c , x = map(int, input().split())
count = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range (c+1):
            if i * 500 + j * 100 + k * 50 == x:
                count += 1

print(count)


### FIXED CODE ###

a , b, c , x = [int(input()) for i in range(4)]
count = 0

for i in range(a+1):
    for j in range(b+1):
        for k in range (c+1):
            if i * 500 + j * 100 + k * 50 == x:
                count += 1

print(count)
# -*- coding: utf-8 -*-
from math import factorial

n = int(input())
strlist = []
for i in range(n):
    strlist.append(list(str(input())))

allcount = 0
while (len(strlist) > 1):
    i = 1
    count = 1
    while True:
        if(set(strlist[0]) == set(strlist[i])):
            count += 1
            strlist.pop(i)
        else:
            i += 1
        if(i==len(strlist)):
            if(count > 1):
                allcount += int(factorial(count) / factorial(2) / factorial(count-2))
            break
    strlist.pop(0)
print(allcount)

### FIXED CODE ###

n = int(input())
strdict = {}
count = 0
for i in range(n):
    sortedstr = "".join(sorted(str(input())))
    strdict.setdefault(sortedstr, 0)
    count += strdict[sortedstr]
    strdict[sortedstr] += 1
print(count)
import numpy as np
N = int(input())
array = np.arange(N)
print(sum(array))

### FIXED CODE ###

N = int(input())
print((N-1)*(1 + N-1) // 2)
a,b,c,d = list(map(int,input().split()))
print(min(a,b)+min(c,d))

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a,b)+min(c,d))
n = int(input())
ans = 0
for i in range(1,n + 1):
  if n % 2 == 0:
    continue
  cnt = 0
  for j in range(1,i + 1):
    if i % j = 0:
      cnt += 1
  if cnt == 8:
    ans += 1
print(ans)

### FIXED CODE ###

n = int(input())
ans = 0
for i in range(1,n + 1):
  if i % 2 == 0:
    continue
  cnt = 0
  for j in range(1,i + 1):
    if i % j == 0:
      cnt += 1
  if cnt == 8:
    ans += 1
print(ans)
W, H, x, y = map(int, input().split())
print(W*H/2, 1 if 2*x == W and 2*y = H else 0)


### FIXED CODE ###

W, H, x, y = map(int, input().split())
if 2*x == W and 2*y == H:
    B=1
else: 
    B=0
print(W*H/2, B)
import Decimal from decimal as de

a, b = input().split()
a = int(a)
b = de(float(b))
print(int(a*b))

### FIXED CODE ###

import decimal

A, B = input().split()
A = int(A)
B = decimal.Decimal(B)
C = A * B
C = int(C)
print(C)
def find(tab, a):
    if tab[0][a]==-1:
        return a
    tab[0][a] = find(tab, tab[0][a])
    return tab[0][a]

def union(tab, a, b):
    p1, p2 = find(tab, a), find(tab, b)
    if p1 != p2:
        tab[0][p1] = p2
        tab[1][p2] += tab[1][p1]

def size(tab, a):
    return tab[1][a]

N, M = [int(a) for a in input().split(" ")]
ABs = [[int(a) for a in input().split(" ")] for i in range(M)]
tab = [[-1]*N, [1]*N]
arr = []

for a, b in reversed(ABs):
    a, b = a-1, b-1
    try:
        pa, pb = find(tab, a), find(tab, b)
        na, nb = size(tab, pa), size(tab, pb)
    except:
        pass
    if pa!=pb:
        dn = ((na+nb)*(na+nb-1)//2)-(na*(na-1)//2)-(nb*(nb-1)//2)
        arr.append(dn)
        union(tab, a, b)
    else:
        arr.append(0)

acc = 0
for cp in reversed(arr):
    acc += cp
    print(acc)


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

def find(tab, a):
    if tab[0][a]==a:
        return a
    tab[0][a] = find(tab, tab[0][a])
    return tab[0][a]

def union(tab, a, b):
    p1, p2 = (find(tab, a), find(tab, b))
    if p1 != p2:
        tab[0][p1] = p2
        tab[1][p2] += tab[1][p1]

def size(tab, a):
    return tab[1][a]

N, M = [int(a) for a in input().split(" ")]
ABs = [[int(a) for a in input().split(" ")] for i in range(M)]
tab = [[i for i in range(N)], [1 for i in range(N)]]
arr = []

for a, b in reversed(ABs):
        a, b = (a-1, b-1)
        pa, pb = (find(tab, a), find(tab, b))
        na, nb = (size(tab, pa), size(tab, pb))
        if pa!=pb:
            dn = ((na+nb)*(na+nb-1)//2)-(na*(na-1)//2)-(nb*(nb-1)//2)
            arr.append(dn)
            union(tab, a, b)
        else:
            arr.append(0)

acc = 0
for cp in reversed(arr):
    acc += cp
    print(acc)
n, k, q = list(map(int,input().split(' ')))
import numpy as np
point =np.full(k, n)
for i in range(q):
  point-=1
  point[int(input())-1]+=1

for i in point:
  if i>0:
    print('Yes')
  else:
    print('No')


### FIXED CODE ###

n, k, q = list(map(int,input().split(' ')))
import numpy as np
point =np.full(n,k-q)
for i in range(q):
  win = int(input())
  point[win-1]+=1
  
  
#print(np.where(point>0,'Yes','No'))
for i in point:
  if i>0:
    print('Yes')
  else:
    print('No')
n=int(input())
a=[]
for i in range(1,n-1):
    a[i]=int(input())



### FIXED CODE ###


def is_prime(n):

    if n == 2:
        return True
    elif n < 2 or n & 1 == 0:
        return False
    for i in range(3, int(n**0.5) + 1, 2):
        if n % i == 0:
            return False
    return True

N = int(input())
cnt = 0
for i in range(N):
    e = int(input())
    if is_prime(e):
        cnt += 1
print(cnt)
import numpy as np
N = int(input())
arr = np.array(list(map(int, input().split())))
u, count = np.unique(arr, return_counts=True)
comb = []
for i in count:
    comb.append(i*(i-1)/2)
total = np.sum(comb)
comb = np.array(comb)
for i in arr:
    print(int(total- count[u==i][0]+1))

### FIXED CODE ###

import collections
N = int(input())
arr = list(map(int, input().split()))
count = collections.Counter(arr)
total = 0
for i in count.values():
    total += (i*(i-1)/2)
for i in arr:
    print(int(total- count[i]+1))
import re
S = input()

s = []
for i in range(1000):
    s.append(str(i*2019))

count = []
for i in s:
    count += len(re.findall(S, i))

print(count)

### FIXED CODE ###

S = input()

n = len(S)
m = 2019

S_ = S[::-1]

x = 1
total = 0
modlis = [0 for i in range(m)]

ans = 0
for i in range(n):
    modlis[total] += 1
    #print("S_[i]:", S_[i])
    #print("int(S_[i])*x:", int(S_[i])*x)
    #print("total:", total)
    total += int(S_[i])*x
    #print("total:", total)
    total %= m
    #print("total:", total)
    ans += modlis[total]
    #print("x:", x)
    x = x * 10 % m
    #print("x:", x)

print(ans)
from sys import stdin

def readString() :
    return  stdin.readline().rstrip()

def solve() :
    H,W = [int(x) for x in stdin.readline().rstrip().split()]

    table = [stdin.readline().rstrip().split() for _ in range(H)]

    l = [x for x in "ABCDEFGHIJK"]
    for h in range(0,H) :
        for w in range(0,W) :
            if(table[h][w] == "snuke"):
                print(l[w] + "" + str(h + 1))
solve();

### FIXED CODE ###

from sys import stdin

def readString() :
    return  stdin.readline().rstrip()

def solve() :
    H,W = [int(x) for x in stdin.readline().rstrip().split()]

    table = [stdin.readline().rstrip().split() for _ in range(H)]

    l = [chr(i) for i in range(65, 65+26)]
    for h in range(0,H) :
        for w in range(0,W) :
            if(table[h][w] == "snuke"):
                print(l[w] + "" + str(h + 1))
solve();
A,B,C=int(input()),int(input()),int(input())
if (A-B)>=C:
    print(0)
else:
    print(C-A+B)

### FIXED CODE ###

A,B,C=map(int,input().split())
if (A-B)>=C:
    print(0)
else:
    ans=C-A+B
    print(ans)
H, W = map(int, input().split())
S = []
for i in range(H):
    S.append(input())

#white = ".", black = "#"
def search(x, y, color):
    if color == ".":
        for m in [1, -1]:
            if 0 <= x+m <= H-1:
                if S[x+m][y] == "#" and not dp[x+m][y]:
                    dp[x+m][y] = True
                    color = "#"
                    search(x+m, y, color)
        for n in [1, -1]:
            if 0 <= y+n <= W-1:
                if S[x][y+n] == "#" and not dp[x][y+n]:
                    dp[x][y+n] = True
                    color = "#"
                    search(x, y+n, color)

    else:
        for m in [1, -1]:
            if 0 <= x+m <= H-1:
                if S[x+m][y] == "." and not dp[x+m][y]:
                    dp[x+m][y] = True
                    color = "."
                    search(x+m, y, color)

        for n in [1, -1]:
            if 0 <= y+n <= W-1:
                if S[x][y+n] == "." and not dp[x][y+n]:
                    dp[x][y+n] = True
                    color = "."
                    search(x, y+n, color)


ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            dp = [[False for a in range(W)] for b in range(H)]
            dp[i][j] = True
            search(i, j, "#")
            for k in range(H):
                for l in range(W):
                    if dp[k][l] and S[k][l] == ".":
                        ans += 1

print(ans)


### FIXED CODE ###

H, W = map(int, input().split())
import sys
sys.setrecursionlimit(500000)
S = []
for i in range(H):
    S.append(input())

#white = ".", black = "#"
def search(x, y, color):
    global black
    global white
    if color == ".":
        for m in [1, -1]:
            if 0 <= x+m <= H-1:
                if S[x+m][y] == "#" and not dp[x+m][y]:
                    black += 1
                    dp[x+m][y] = True
                    color = "#"
                    search(x+m, y, color)
        for n in [1, -1]:
            if 0 <= y+n <= W-1:
                if S[x][y+n] == "#" and not dp[x][y+n]:
                    black += 1
                    dp[x][y+n] = True
                    color = "#"
                    search(x, y+n, color)

    else:
        for m in [1, -1]:
            if 0 <= x+m <= H-1:
                if S[x+m][y] == "." and not dp[x+m][y]:
                    white += 1
                    dp[x+m][y] = True
                    color = "."
                    search(x+m, y, color)

        for n in [1, -1]:
            if 0 <= y+n <= W-1:
                if S[x][y+n] == "." and not dp[x][y+n]:
                    white += 1
                    dp[x][y+n] = True
                    color = "."
                    search(x, y+n, color)


ans = 0
dp = [[False] * W for a in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == "#" and not dp[i][j]:
            black = 1
            white = 0
            dp[i][j] = True
            search(i, j, "#")
            ans += black * white

print(ans)
import sys
param=sys.argv
menseki=int(param[1])*int(param[2])
nagasa=int(param[1])*2+int(param[2])*2
print(str(menseki)+" "+str(nagasa))

### FIXED CODE ###

import sys
param=input().split()
menseki=int(param[0])*int(param[1])
nagasa=int(param[0])*2+int(param[1])*2
print(menseki,nagasa)
import collections
N=int(input())
s=[str(input()) for i in range(N)]
c=collections.Counter(s)
maximum =max(c.values()) 
max_c_list = soreted(key for key,value in c.items() if value == maximum)
for s in max_c_list:
  print(s)

### FIXED CODE ###

import collections
N=int(input())
s=[str(input()) for i in range(N)]
c=collections.Counter(s)
maximum =max(c.values()) 
max_c_list = sorted(key for key,value in c.items() if value == maximum)
for s in max_c_list:
  print(s)
s = str(input())s = str(input())

l = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(1,8):
    if s == l[i-1]:
        print(8-i)


### FIXED CODE ###

s = str(input())

l = ["SUN","MON","TUE","WED","THU","FRI","SAT"]

for i in range(1,8):
    if s == l[i-1]:
        print(8-i)
ls = list()
lt = list()
la = list()
LS = list()
LT = list()
LA = list()
N = int(input())
for i in range(1, N+1):
    T, A = map(int, input().split())
    X = T + A
    ls.append(X)
    lt.append(T)
    la.append(A)
    LS.append(X)
    LT.append(T)
    LA.append(A)
print(lt, la, LT, LA)
for j in range(1, N):
    while ls[j] < ls[j-1]:
        ls[j] += LS[j]
    while lt[j] < lt[j-1] or la[j] < la[j-1]:
        lt[j] += LT[j]
        la[j] += LA[j]
    print(lt[j], la[j], LT[j], LA[j])
print(lt[N-1] + la[N-1])

### FIXED CODE ###

a, b, c = map(int, input().split())
d = a - b
e = b - c
f = c - a
if d != 0 and e != 0 and f != 0:
    print(3)
elif d == 0 and e != 0 and f != 0:
    print(2)
elif d != 0 and e == 0 and f != 0:
    print(2)
elif d != 0 and e != 0 and f == 0:
    print(2)
elif d == 0 and e == 0 and f == 0:
    print(1)