Harryxun/stf_run huggingface dataset:
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a = Counter(a).most_common()
b = []
for i,j in a:
    if j >=4:
        b.append(i)
        b.append(i)
    elif j >= 2:
        b.append(i)
b.sort()
if len(b)>=2:
    print(b[-1]*b[-2])
else:
    print(0)
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a = Counter(a)
b = []
for i,j in a:
    if j >=4:
        b.append(i)
        b.append(i)
    elif j >= 2:
        b.append(i)
b.sort()
if len(b)>=2:
    print(b[-1]*b[-2])
else:
    print(0)
提出情報

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a = Counter(a).most_common()
b = []
for i,j in a:
    if j >=4:
        b.append(i)
        b.append(i)
    elif j >= 2:
        b.append(i)
b.sort()
if len(b)>=2:
    print(b[-1]*b[-2])
else:
    print(0)
tmp = input().split(" ")
A = int(tmp[0])
B = int(tmp[1])

import math
print(math.max(A - 2 * B, 0))

### FIXED CODE ###

tmp = input().split(" ")
A = int(tmp[0])
B = int(tmp[1])

print(max([A - 2 * B, 0]))
def cutter(nums):
    if len(nums) < 2:
        return []
    
    for i in xrange(1, len(nums)):
        if int(nums[i]) != int(nums[i-1]):
            pos = i
            flag = int(nums[i]) > int(nums[i-1])  # is asc?
            # print flag
            break
    else:
        return []

    for i in xrange(pos, len(nums)):

        if flag:
            if int(nums[i]) < int(nums[i-1]):
                return nums[i:]
        else:
            if int(nums[i]) > int(nums[i-1]):
                return nums[i:]
    return []


n = int(raw_input())
arr = raw_input().split()
if n < 2:
    print n
else:
    count = 0
    while arr:
        print arr
        count += 1
        arr = cutter(arr)

    print count

### FIXED CODE ###

def cutter(nums, idx):
    if len(nums) - idx <= 2:
        return len(nums)
    
    for i in xrange(idx+1, len(nums)):
        if int(nums[i]) != int(nums[i-1]):
            pos = i
            flag = int(nums[i]) > int(nums[i-1])  # is asc?
            # print flag
            break
    else:
        return len(nums)

    for i in xrange(pos, len(nums)):

        if flag:
            if int(nums[i]) < int(nums[i-1]):
                return i
        else:
            if int(nums[i]) > int(nums[i-1]):
                return i
    return len(nums)


n = int(raw_input())
idx = 0
arr = raw_input().split()
if n < 2:
    print n
else:
    count = 0
    while idx < n:
        # print arr[idx:]
        count += 1
        idx = cutter(arr, idx)

    print count
N,K = map(int,input().split())
A = list(map(int,input().split()))
A = [i-1 for i in A]

flag = [False]*N
from collections import deque

q = deque([])
q.append(0)
flag[0] = True
now = 0
while True:
  now = A[now]
  if flag[now]:
    break
  else:
    flag[now] = True
    q.append(now)
    
l = list(q)
if K<=len(l):
  print(l[K]+1)

else:
  for i,x in enumerate(l):
    if x==now:
      l = l[i:]
      K -= i
      break
  
  print(l[K%len(l)]+1)

### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
A = [i-1 for i in A]

flag = [False]*N
from collections import deque

q = deque([])
q.append(0)
flag[0] = True
now = 0
while True:
  now = A[now]
  if flag[now]:
    break
  else:
    flag[now] = True
    q.append(now)
    
l = list(q)
if K<len(l):
  print(l[K]+1)

else:
  for i,x in enumerate(l):
    if x==now:
      l = l[i:]
      K -= i
      break
  
  print(l[K%len(l)]+1)
n,m = map(int, input().split())
dic = {}

AB = [map(int, input().split()) for _ in range(m)]

links = [[] for _ in range(N + 1)]

for a,b in AB:
    a -= 1
    b -= 1

    links[a].append(b)
    links[b].append(a)

dist = {}
queue = []
visited = []
pre = {}

dist[0] = 0 
queue.append(0)

while len(queue) > 0:
    v = queue.pop(0)
    
    for i in dic[v]:
        if i in visited:
            continue
        
        visited.append(i)
        dist[i] = dist[v] + 1
        pre[i]= v
        queue.append(i)


print("Yes")
for i in range(n):
    ans = 0
    
    if(i == 0):
        continue
    
    ans = pre[i]
    ans += 1
    print(ans)

### FIXED CODE ###

from collections import deque

n,m = map(int, input().split())
dic = {}

AB = [map(int, input().split()) for _ in range(m)]

dic = [[] for _ in range(n + 1)]

for a,b in AB:
    a -= 1
    b -= 1

    dic[a].append(b)
    dic[b].append(a)

#dist = {}
queue = deque([0])
visited = []
pre = [-1] * (n+1)

#dist[0] = 0 
queue.append(0)

while queue:
    v = queue.popleft()
    
    for i in dic[v]:
        if pre[i] == -1:
        #dist[i] = dist[v] + 1
            pre[i]= v
            queue.append(i)

print("Yes")
for i in range(n):
    ans = 0
    
    if(i == 0):
        continue
    
    ans = pre[i]
    ans += 1
    print(ans)
import sys
input = sys.stdin.readline

H, W = map(int, input().split())
field = ['' for _ in range(H)]
seen = [[False for _ in range(W)] for _ in range(H)]
seen_black = [[False for _ in range(W)] for _ in range(H)]

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
stop = (0, 0)
next_start = (0,0)
def dfs(h, w):
    global stop
    seen[h][w] = True
    for dir in range(4):
        nh = h + dx[dir]
        nw = w + dy[dir]
        
        if nh < 0 or nh >= H or nw < 0 or nw >= W:
            continue
        if field[nh][nw] == '#':
            step = max(stop[0]+stop[1], nh+nw)
            if step != stop[0]+stop[1]:stop = (nh, nw)
            continue
        if seen[nh][nw] == True:
            continue
        dfs(nh, nw)
def dfs_black(h, w):
    global next_start
    seen_black[h][w] = True
    for dir in range(4):
        nh = h + dx[dir]
        nw = w + dy[dir]
        
        if nh < 0 or nh >= H or nw < 0 or nw >= W:
            continue
        if field[nh][nw] == '.':
            step = max(next_start[0]+next_start[1], nh+nw)
            if step != next_start[0]+next_start[1]:next_start = (nh, nw)
            continue
        if seen_black[nh][nw] == True:
            continue
        dfs_black(nh, nw)    

for h in range(H):
    field[h] = input().rstrip("\r\n")

sh, sw, gh, gw = 0, 0, H-1, W-1
ans = 0
is_next = True
if field[sh][sw] == "#":
    is_next = False
else:
    is_next = True

while seen[gh][gw] != True and seen_black[gh][gw] != True:
    if is_next:
        dfs(sh,sw)
        sh, sw = stop
        is_next = False
    else:
        ans += 1
        # if sh == gh and sw == gw:
        #     break
        dfs_black(sh,sw)
        sh, sw = next_start
        is_next = True
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import deque
def main():
    H, W = map(int, input().split())
    field = [input().rstrip("\r\n") for _ in range(H)]
    dv = 201
    counts = [[dv for _ in range(W)] for _ in range(H)]
    que = deque([(0, 0)])
    if field[0][0] == "#":
        counts[0][0] = 1
    else:
        counts[0][0] = 0
    while len(que) > 0:
        h, w = que.popleft()
        for dh, dw in [(1, 0), (0, 1)]:
            nh, nw = h + dh, w + dw
            if nh >= H or nw >= W:continue
            if counts[nh][nw] == dv:que.append((nh, nw))
            if field[h][w] != field[nh][nw]:
                counts[nh][nw] = min(counts[nh][nw], counts[h][w]+1)
            else:
                counts[nh][nw] = min(counts[nh][nw], counts[h][w])
    if field[-1][-1] == "#":counts[-1][-1] += 1
    print(counts[-1][-1]//2)
if __name__ == "__main__":
    main()
g,r=map(int,input().split())
print(2*g-r)

### FIXED CODE ###

r=int(input())
g=int(input())
print(2*g-r)
num = input()
li = []

for i in range(len(num) - 2):
  li.append(abs(int(num[i]) * 100 + int(num[i+1]) * 10 + int(num[i+2]) - 753))

print(min(li))


### FIXED CODE ###

num = int(input())

if num == 3or num == 5 or num == 7:
  print("YES")
else:
  print("NO")
N,K = map(int,input().split())
p = list(map(int,input().split()))

p.sort()
print(sum(p[:K])

### FIXED CODE ###

N,K = map(int,input().split())
p = list(map(int,input().split()))

p.sort()
ans = 0
for i in range(K):
    ans += p[i]
print(ans)
N = int(input())
if int(str(N)[1:]) ==0:
  print(0)
else:
    print(1000-int(str(N)[1:])) 

### FIXED CODE ###

N = int(input())
if 1 <= N <= 999:
  print(1000-N)
elif int(str(N)[1:]) ==0:
  print(0)
else:
    print(1000-int(str(N)[1:]))
import math
def main():
    N = map(int, input())
    l = [int(_) for _ in input().split()]
    count_list = [0] * N
    for i in l:
        index = i - 1
        count_list[index] += 1

    for out in count_list:
        print(out + '\n')
main()

### FIXED CODE ###

import math
def main():
    N = int(input())
    l = [int(_) for _ in input().split()]
    count_list = [0] * N
    for i in l:
        index = i - 1
        count_list[index] += 1

    for out in count_list:
        print(out)
main()
def Fib(n):    
    if n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return Fib(n-1)+Fib(n-2)

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

list=[]
for i in range(M):
    list.append(int(input()))

for i in range(1,len(list)):
    if list[i]-list[i-1] == 1:
        print(0)
        exit()

num_list = []
rest = N
cnt = 0

list.sort(reverse = True)
rest = N + 1
for i in list:
    num_list.append(rest - i - 1)
    rest = i
num_list.append(list[-1])

ans = 1
for i in num_list:
    ans = ans * Fib(i+1)
print(ans % 1000000007)


### FIXED CODE ###

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

a = [int(input()) for i in range(M)]

#初期化
dp=[-1]*N
dp[0]=1

for i in a:
    dp[i-1] = 0

for i in range(1,N):
    if dp[i]==0:
        continue
    elif i==1:
        dp[i]=dp[i-1] + 1
    else:
        dp[i]=dp[i-1]+dp[i-2]

print(dp[N-1]%1000000007)
a,b = split(int,input())

### FIXED CODE ###

a,b = map(int,input().split())
 
if a*b % 2 == 1:
    print("Odd")
else:
    print("Even")
n,a,b=map(int,input().split())
if a+b-n>0:
  ans=a+b-n
else:
  ans==0
print(min(a,b),ans,sep=' ')

### FIXED CODE ###

n,a,b=map(int,input().split())
if a+b-n>0:
  ans=a+b-n
else:
  ans=0
print(min(a,b),ans,sep=' ')
f = int(input()) / 3.0
print("{.9f}".format(f * f * f))


### FIXED CODE ###

f = int(input()) / 3.0
print("{:.9f}".format(f * f * f))
a = []
b = {}
n = int(input())
for _ in range(n):
    s, i = input().split()
    a += [(s, int(i))]
    b.setdefault(int(d), []).append(v)
b = {val: iter(s).__next__ for val, s in D.items()}

def partition(a, left, right):
    standard = a[right][1]
    cnt = left
    for i in range(left, right):
        if a[i][1] <= standard:
            a[cnt],a[i] = a[i], a[cnt]
            cnt += 1
    a[cnt],a[i] = a[i], a[cnt]
    return cnt

def quickSort(a, left = 0, right = len(a) - 1):
    if 1 <= right - left:
        cnt_ = partition(a, left, right)
        quickSort(a,left, cnt_ - 1)
        quickSort(a,cnt_ + 1, right)

quickSort(a, 0 , len(a)-1)

ok = 1
for v, d in A:
    if D[d]() != v:
        ok = 0
print(['Not stable','Stable'][ok])


for i in range(n):
    print(*a[i])


### FIXED CODE ###

a = []
b = {}
n = int(input())
for _ in range(n):
    s, i = input().split()
    a += [(s, int(i))]
    b.setdefault(int(i), []).append(s)
b = {val: iter(s).__next__ for val, s in b.items()}

def partition(a, left, right):
    standard = a[right][1]
    cnt = left
    for i in range(left, right):
        if a[i][1] <= standard:
            a[cnt],a[i] = a[i], a[cnt]
            cnt += 1
    a[cnt],a[right] = a[right], a[cnt]
    return cnt

def quickSort(a, left = 0, right = len(a) - 1):
    if 1 <= right - left:
        cnt_ = partition(a, left, right)
        quickSort(a,left, cnt_ - 1)
        quickSort(a,cnt_ + 1, right)

quickSort(a, 0 , len(a)-1)

ok = 1
for s, i in a:
    if b[i]() != s:
        ok = 0
print(['Not stable','Stable'][ok])


for i in range(n):
    print(*a[i])
import sys
C=range(1000)
f=0
d=[[0 for i in C] for j in range(2)]
for s in sys.stdin.readlines():
    if s=="\n":f+=1
    else:
        a,b=map(int,s.split(','))
        d[f][a]+=1
for i in C:
    a=d[0][i]
    b=d[1][i]
    if a!=0 and b!=0: print i, a+b

### FIXED CODE ###

import sys
C=range(1001)
m=0
d=[[0 for i in C] for j in range(2)]
for s in sys.stdin.readlines():
    if s=="\n":m+=1
    else:
        a,b=map(int,s.split(','))
        d[m][a]+=1
for i in C:
    a=d[0][i]
    b=d[1][i]
    if a and b:print i,a+b
N = int(input())
A = list(map(int, input().split()))

for k in range(N):
    del A[k]
    ans = 0
    
    for i in range(1,N+1):
        n = A.count(i)
        nc2 = n * (n-1) / 2
        ans += nc2
    print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = [0 for _ in range(max(a)+1)]
for x in a:
    b[x] += 1
c = sum([x*(x-1)//2 for x in b])
for i in range(n):
    print(c-b[a[i]]+1)
import sys

a, b, c, d = input()

for i in range(2**3):
    op = ['','','']
    for j in range(3):
        if (i >> j) & 1:
            op[j] = '+'
        else:
            op[j] = '-'
        if eval(a + op[0] + b + op[1] + c + op[2] + d) == 7:
            print(a + op[0] + b + op[1] + c + op[2] + d + "=7")
            sys.exit()

### FIXED CODE ###

import sys

a, b, c, d = input()

for i in range(2**3):
    op = ['','','']
    for j in range(3):
        if (i >> j) & 1:
            op[j] = '+'
        else:
            op[j] = '-'
    if eval(a + op[0] + b + op[1] + c + op[2] + d) == 7:
        print(a + op[0] + b + op[1] + c + op[2] + d + "=7")
        sys.exit()
import random
s=list(input())
t=list(input())
random.shuffle(s)
random.shuffle(t)
S=''.join(s)
T=''.join(t)
L=[S,T]
L.sort()
if T==S:
  print('No')
elif L[0]==S:
  print('Yes')
elif L[0]==T:
  print('No')



### FIXED CODE ###

a,b=map(int,input().split())
x=(a+b)/2
if int(x)==x:
   print(int(x))
else :
   print(int(x)+1)
x=input () 
if x>=30:
  print ('Yes') 
else:
  print('No') 

### FIXED CODE ###

x=input() 
x=int(x) 
if x>=30:
  print ('Yes') 
else:
  print('No')
a = int(input())
if a=A or B or C or D or E or F or G or H or I or J or K or L or M or N or O or P or Q or R or S or T or U or V or W or X or Y or Z:
  print("A")
else:
  print("a")

### FIXED CODE ###

a = str(input())
if a.isupper() == True:
  print("A")
else:
  print("a")
import math
a, b = input().split()
if sqrt(int(a+b)) % 1 == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b=map(int,input().split())
if (a)%2 == 0:
  print("Even")
elif (b)%2 == 0:
	print("Even")
else:
  print("Odd")
n = map(int,input())


def base-2(n):
    a = ()
    while n! = 0:
        r = n % 2:
        if (r < 0):
            r += 2

            n = (n - r)/2
            a.append(str(r))
    if(a = ""):
    a = "0"
    reversed(a)
print(base(n))

### FIXED CODE ###

n = int(input())

def basen(n):
    a = []
    while n!= 0:
        r = n % 2
        if (r < 0):
            r += 2

        n = (n - r)//(-2)
        a.append(r)
    if a == []:
        a.append(0)
    a.reverse()
    return "".join(map(str,a))
print(basen(n))
import numpy as np
n,l=int(input()),list(map(float,input().split()))
dp=np.full([n+1,n+1],0.0)
dp[0][0]=1.0

### FIXED CODE ###

n,l=int(input()),list(map(float,input().split()))
dp=[[0.0]*(n+1) for _ in range(n+1)]
dp[0][0]=1.0
for i in range(1,n+1):
    for j in range(i+1):
        if j==0:
            dp[i][j]=dp[i-1][j]*(1.0-l[i-1])
        else:
            dp[i][j]=dp[i-1][j]*(1.0-l[i-1])+dp[i-1][j-1]*l[i-1]
print(sum(dp[n][((n+1)//2):]))
from math import pi
r=import()
print("{0:.5f} {1:.5f}".format(pi*r*r,2*pi*r))

### FIXED CODE ###

from math import pi
r=float(input())
print("{0:.5f} {1:.5f}".format(pi*r*r, 2*pi*r))
#import sys
import math

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

N = int(input())
#A, B = list(map(int,input().split()))
S = [''.join(sorted(input())) for _ in range(N)]
D = {}
for s in S :
    if s in D :
        D[s] += 1
    else :
        D[s] = 1
V = list(D.values())
count = 0
for v in V :
    if v == 1 :
        count += 0
    elif v == 2 :
        count += 1
    elif v >= 3 :
        count += nCr(v,2)
print(count)

### FIXED CODE ###

#import sys
# import math

def modc(a, b, m):
    c = 1
    for i in range(b):
        c = c * (a - i) % m
        c = c * modinv(i + 1, m) % m
    return c


def egcd(a, b):
    (x, lastx) = (0, 1)
    (y, lasty) = (1, 0)
    while b != 0:
        q = a // b
        (a, b) = (b, a % b)
        (x, lastx) = (lastx - q * x, x)
        (y, lasty) = (lasty - q * y, y)
    return (lastx, lasty, a)


def modinv(a, m):
    (inv, q, gcd_val) = egcd(a, m)
    return inv % m

N = int(input())
#A, B = list(map(int,input().split()))
S = [''.join(sorted(input())) for _ in range(N)]
D = {}
for s in S :
    if s in D :
        D[s] += 1
    else :
        D[s] = 1
V = list(D.values())

count = 0
for v in V :
    if v == 1 :
        count += 0
    elif v == 2 :
        count += 1
    elif v >= 3 :
        count += modc(v, 2, 2 ** 63 - 1)
print(count)
import heapq;

n, u, v = [int(v) for v in input().split()]

vert = []

for i in range(n):
    vert.append([])

for i in range(n - 1):
    a, b = [int(v) - 1 for v in input().split()]
    vert[a].append(b)
    vert[b].append(a)

taka = u-1
aoki = v-1

if taka == aoki:
    return 0

q = [(0, aoki)]
aoki_dist = [-1] * n
aoki_dist[aoki] = 0

index = 0
while index < len(q):
    c0, i = q[index]
    c = c0 + 1
    for l in vert[i]:
        if aoki_dist[l] >= 0:
            continue
        aoki_dist[i] = c
        q.append((c, l))
    index += 1

q = [(0, taka)]
max_dist = aoki_dist[taka]

index = 0
while index < len(q):
    c0, i = q[index]
    c = c0 + 1
    for l in vert[i]:
        if aoki_dist[l] < 0:
            continue
        if c >= aoki_dist[l]:
            continue
        if max_dist < aoki_dist[l]:
            max_dist = aoki_dist[l]
        aoki_dist[l] = -1
        q.append((c, l))
    index += 1

print(max_dist - 1)

### FIXED CODE ###

import heapq;

n, u, v = [int(v) for v in input().split()]

vert = []

for i in range(n):
    vert.append([])

for i in range(n - 1):
    a, b = [int(v) - 1 for v in input().split()]
    vert[a].append(b)
    vert[b].append(a)

taka = u-1
aoki = v-1

if taka == aoki:
    print(0)
    exit()

def bfs(begin):
    q = [(0, begin)]
    dist = [-1] * n
    dist[begin] = 0

    index = 0
    while index < len(q):
        c0, i = q[index]
        c = c0 + 1
        for l in vert[i]:
            if dist[l] >= 0:
                continue
            dist[l] = c
            q.append((c, l))
        index += 1
    return dist

aoki_dist = bfs(aoki)
taka_dist = bfs(taka)

ans = 0
for i in range(n):
    if taka_dist[i] < aoki_dist[i]:
        ans = max(ans, aoki_dist[i] - 1)

print(ans)
#!/usr/bin/env python3
import sys
MOD = 1000000007  # type: int

def permutations_count(n, k):
    if k>n or k<0:
        return 0
    if k == 0:
        return 1
    return n * permutations_count(n-1, k-1) % MOD

def solve(N: int, K: int, a: "List[int]", b: "List[int]"):
    matrix = [[] for _ in range(N+1)]
    for i in range(N-1):
        matrix[a[i]].append(b[i])
        matrix[b[i]].append(a[i])
    
    visited = [0]*(N+1)

    from collections import deque
    queue = deque()
    visited[1]=1
    answer = K
    answer *= permutations_count(K-1,len(matrix[1]))
    for node in matrix[1]:
        queue.append(node)

    while queue:
        q = queue.popleft()

        if visited[q] == 0:
            answer *= permutations_count(K-2,len(matrix[q])-1) #親ノード引いてる
        else:
            continue

        visited[q] = 1

        for child_node in matrix[q]:
            if child_node != q:
                queue.append(child_node)

    print(answer%MOD)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, K, a, b)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
MOD = 1000000007  

def solve(N: int, K: int, a: "List[int]", b: "List[int]"):
    matrix = [[] for _ in range(N+1)]
    for i in range(N-1):
        matrix[a[i]].append(b[i])
        matrix[b[i]].append(a[i])
    
    visited = [0]*(N+1)

    from collections import deque
    queue = deque()
    visited[1]=1
    answer = K
    num = K-1
    for node in matrix[1]:
        answer *= num
        answer %= MOD

        num -= 1
        queue.append(node)

    while queue:
        q = queue.popleft()
        if visited[q] != 0:
            continue
        visited[q] = 1

        num = K-2
        for child_node in matrix[q]:
            if visited[child_node] == 0:
                answer *= num
                answer %= MOD
                num -= 1
                queue.append(child_node)
        answer %= MOD

    print(answer%MOD)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    solve(N, K, a, b)

if __name__ == '__main__':
    main()
from collections import Counter

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
n = int(input())
print(len(Counter(n)))

### FIXED CODE ###

# coding: utf-8
# Your code here!

from collections import Counter

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
n = int(input())
x = Counter(prime_factorize(n))
x_keys = list(x.keys())
x_values = list(x.values())
ans = 0
for i in range(len(x_keys)):
    z = x_values[i]
    mai = 1
    while z - mai >= 0:
        z -= mai
        mai += 1
        ans += 1
print(ans)
i1 = input()
i2 = int(i1.split(" ")[0])
i3 = int(i1.split(" ")[1])
i4 = 0
i5 = 0
i6 = 0
li = []
for i in range(i2):
  i4 = input().split(" ")
  i5 = (int(i4[1]) ** 2 - int(i4[0]) ** 2) ** 0.5
  if (i3 >= i5) {
    i6 += 1
  }
print(i6)

### FIXED CODE ###

i1 = input()
i2 = int(i1.split(" ")[0])
i3 = int(i1.split(" ")[1])
i4 = 0
i5 = 0
i6 = 0
li = []
for i in range(i2):
  i4 = input().split(" ")
  i5 = (float(i4[1]) ** 2 + float(i4[0]) ** 2) ** 0.5
  if i3 >= abs(i5):
    i6 += 1
print(i6)
t = [int(v) for v in split(input())]

n = t[0] - t[1]
n2 = t[0] - t[2]
if abs(n) > abs(n2):
  print(n2)
else:
  print(n)

### FIXED CODE ###

t = [int(v) for v in input().split(" ")]

n = t[0] - t[1]
n2 = t[0] - t[2]
if abs(n) > abs(n2):
  print('B')
else:
  print('A')
k,s = map(int,input().split())

count = 0
for x in range(k+1):
  for y in range(k+1):
    if x + y > s:
      break
    a = s - x - y
    if a >= 0 && a <= k:
      count += 1

print(count)

### FIXED CODE ###

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

count = 0
for x in range(k+1):
  for y in range(k+1):
    a = s - x - y
    if a >= 0 and a <= k:
      count += 1

print(count)
# 社員数
n = int(input())

# 社員番号
a = (int(x) for x in input().split())

# 要素数指定
ans = [0] * n

for i in range(n - 1):
    ans[a[i] - 1] = ans[a[i] - 1] + 1

for i in ans:
    print(i)

### FIXED CODE ###

# 社員数
n = int(input())

# 社員番号
a = list(map(int, input().split()))

# 要素数指定
ans = [0] * n

for i in range(n - 1):
    ans[a[i] - 1] = ans[a[i] - 1] + 1

for i in ans:
    print(i)
N = int(input())
p = list(map(int,input().split()))
count = 0
for i in range(N-1):
  if  p[i + 1] - p[i] != 1:
    count += 1
if count == 2 or count == 0:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,b=map(int, input().split())
ans = a + b
if ans % 2 == 0:
  print(ans //2)
else:
  print("IMPOSSIBLE")