peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    a, b, x = map(int, rl().split())
    ans = b // x - a // x
    if a % x == 0:
        ans += 1
    print(ans)


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
X,Y=map(int,input().split())

ans=0
seki=X

while seki < Y:
    seki*=2
    ans+=1
print(ans)
# Judge status: Wrong Answer
S = input()
T = input()
Flag = False
for X in range(0,len(S)-1):
    if S==T:
        Flag = True
        break
    S = S[-1]+S[0:-1]
if Flag:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())

dp = [1000000 for _ in range(n+1)]
dp[0] = 0

for i in range(0,n):
  if i+1 <= n:
    dp[i+1] = min(dp[i+1], dp[i] + 1)
  for j in range(1,7):
    a = 6**j
    if i+a <= n:
      dp[i+a] = min(dp[i+a], dp[i] + 1)
  for k in range(1,6):
    a = 9**k
    if i+a <= n:
      dp[i+a] = min(dp[i+a], dp[i] + 1)

print(dp[n])
# Judge status: Wrong Answer
import math
a=input()
b=input()
c=input()
if a>b:
 print(math.ceil(int(c)/int(b)))
elif a<b:
 print(math.ceil(int(c)/int(b)))
# Judge status: Accepted
W, a, b = map(int,input().split())
if abs(a - b) <= W:
    print(0)
else:
    print(min(abs(a - (b + W)), abs(b - (a + W))))
# Judge status: Accepted
def main():
    n, k = map(int, input().split())
    a = 1
    i = 0
    while n >= a:
        a = k ** i
        i += 1
    print(i-1)





    
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s = input()
if int(s[5:6]) < 5:
    print('Heisei')
else:
    'TBD'
# Judge status: Wrong Answer
n = int(input())
print(int(n*(n-1)/2))
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]
ls = []
for i, x in enumerate(A):
    ls.append([i+1, x])
ls.sort(key=lambda x: x[1])
cur = 1
num = 0
ans = 0
s = set()
for x, y in ls:
    if cur == y and y not in s and num < x:
        cur += 1
        num = x
        s.add(y)
    else:
        ans += 1
if ans == N:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
n=int(input())
s=input()
kf=0
kn=kp=0
ans=""
for i in range(n):
  if s[i]=="(":
    if kf==0:
      kn+=1
    else:
      ans="("*max(0,kp-kn)+ans+"("*(max(kn,kp)-max(0,kp-kn))+")"*max(kn,kp)
      kn=1
      kp=0
      kf=0
  else:
    if kf==1:
      kp+=1
    else:
      kp=1
      kf=1
ans="("*max(0,kp-kn)+ans+"("*(max(kn,kp)-max(0,kp-kn))+")"*max(kn,kp)
print(ans)
# Judge status: Accepted
s,w=map(int,input().split())

if s <= w:
    print('unsafe')
else:
    print('safe')
# Judge status: Accepted
X, A, B = map(int, input().split())

if A - B >= 0:
  print('delicious')
elif (A + X) - B >= 0:
  print('safe')
else:
  print('dangerous')
# Judge status: Accepted

def resolve():
    S = input().split()
    print(S[0][0]+S[1][0]+S[2][0])
    


if '__main__' == __name__:
    resolve()
# Judge status: Accepted
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
ans = -1
nearest = 10**18
for i in range(n):
    target = t - h[i] * 0.006  # まさかのこれ（アホか？
    if abs(a - nearest) > abs(a - target):
        nearest = target
        ans = i + 1
print(ans)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i + 100*j + 50*k == x:
                ans+=1
print(ans)
# Judge status: Accepted
a = int(input())
x = (a // 11) * 2
if a % 11 > 6:
    x += 2
elif a % 11 > 0:
    x += 1
print(x)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys

N,*A = map(int, sys.stdin.buffer.read().split())

S = [0 for _ in range(10**6+1)]
T = [0 for _ in range(10**6+1)]

for a in A:
  S[a] += 1

count = 0
for i in range(1,10**6+1):
  if T[i] == 1:
    continue
  if S[i] == 0:
    continue
  if S[i] == 1:
    count += 1
  for j in range(10**6//i+1):
    T[i*j] = 1

print(count)
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())

print(((a+b)*h)//2)
# Judge status: Accepted
import math

a,b,h,m = map(int,input().split())

rad_a = (h/12+ (1/12) * (m/60))*360
rad_b = (m/60)*360

if rad_a == rad_b:
    print(abs(b-a))
elif abs(rad_a - rad_b) == 180:
    print(b+a)
else:
    print(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(abs(rad_a-rad_b)))))
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=list(map(int,input().split()))

print(n//(k-1))
# Judge status: Wrong Answer
Q,H,S,D=map(int,input().split())
N=int(input())

ans=0
p=min(Q*8,H*4,S*2,D)
q=N
ans=p*(q//2)

p=min(Q*4,H*2,S)
q=q%2
ans+=p*(q//1)

p=min(Q*2,H)
q=q%1
ans+=p*(q//0.5)

p=Q
q=q%0.5
ans+=p*(q//0.25)

print(int(ans))
# Judge status: Accepted
n, m = map(int, input().split())
x = []
y = []
for i in range(m):
    xi, yi = map(int, input().split())
    x.append(xi)
    y.append(yi)
num = [1]*n
able = [False]*n
able[0] = True
for i in range(m):
    if able[x[i]-1] == True:
        able[y[i]-1] = True
    num[x[i]-1] -= 1
    num[y[i]-1] += 1
    if num[x[i]-1] == 0:
        able[x[i]-1] = False
print(sum(able))
# Judge status: Wrong Answer
import functools
n, x = map(int,input().split())
place = list(map(int,input().split()))
place.append(x)
place.sort()
if n == 1:
    print(place[1] - place[0])
    exit()

k = []
for i in range(1, n):
    k.append(place[i] - place[i-1])

def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)

def gcd(nums):
    return functools.reduce(euclid, nums)

print(gcd(k))
# Judge status: Accepted
check=[list(input()) for i in range(3)]
cur=0
flag=True
while flag:
  if (len(check[0])==0 and cur==0) or (len(check[1])==0 and cur==1) or (len(check[2])==0 and cur==2):
    flag=False
    break
  temp=check[cur].pop(0)
  if temp=="a":
    cur=0
  elif temp=="b":
    cur=1
  else:
    cur=2
if cur==0:
  print("A")
elif cur==1:
  print("B")
else:
  print("C")
# Judge status: Accepted
a=int(input())
s=input()
if a<3200:
  print("red")
else:
  print(s)
# Judge status: Accepted
import sys
from bisect import bisect_left
from collections import deque

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    color = deque([A[0]])

    for i in range(1, N):
        idx = bisect_left(color, A[i])
        if idx == 0:
            color.appendleft(A[i])
        else:
            color[idx - 1] = A[i]

    print(len(color))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n = int(input())
s = list(input())

l = []
string = s[0]
cnt = 0
for i in range(n):
    if string == s[i]:cnt +=1
    else:
        l.append((string, cnt))
        string, cnt = s[i], 1

l.append((string, cnt))
#print(l)
string = l[0]
ans = 0
for str, i in l:
    if string[0] == '#' and str == '.':
        ans += min(i, string[1])
        string = ('.', 0)
    else:
        string = (str, i)
print(ans)
# Judge status: Accepted
import math
H,W = list(map(int, input().split()))

if H == 1 or W == 1:
  print(1)
else:
  print(math.ceil(H*W/2))
# Judge status: Accepted
N = int(input())
D = list(map(int,input().split()))
D.sort()
print(D[N//2] - D[N//2-1])
# Judge status: Accepted
x, y = map(int, input().split())
MOD = 10 ** 9 + 7

if (x+y) % 3 != 0:
    print(0)
    exit()

#m: (i+2, j+1), n (i+1, j+2)

m = (2*x - y) // 3
n = (2*y - x) // 3

if m < 0 or n < 0:
    print(0)
    exit()

ans = 1
i = 1

if n > m:
    n, m = m, n

while i <= n:
    ans *= (m+i) * pow(i, MOD-2, MOD)
    ans %= MOD
    i += 1

print(ans)
# Judge status: Wrong Answer
a,b = map(int,input().split(" "))
k = 1
while ((a-1) * k + 1) < b:
    k +=1
print(k)
# Judge status: Accepted
n = int(input())
s = input()
lis = list(s)

left_w_count = 0
right_e_count = lis[1:].count("E")
ans = right_e_count
for i in range(1,n):
    if lis[i-1] == "W":
        left_w_count += 1
    if lis[i] == "E":
        right_e_count -= 1
    ans = min(ans, left_w_count + right_e_count)

print(ans)
# Judge status: Wrong Answer
K=int(input())
ans=0
runrun = 0
i =1
while runrun < K:
    if i < 10:
        runrun +=1
        ans = i
    else:
        a = list(map(int,str(i)))
        for j in range(1,len(a)):
            tmp = False
            if abs(a[j]-a[j-1]) > 1:
                continue
            runrun +=1
            ans = i 
    i +=1
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())

if a*b%2==0:print('Even')
else:print('Odd')
# Judge status: Wrong Answer
n,m,k = map(int, input().split())

for h in range(n+1):
    for w in range(m+1):
        c = h*(n-w) + w*(m-h)
        if c==k:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
s = input()
t = input()
if s == t[:-1]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N = int(input())
s = list(map(int, input().split()))

count = 0

for i in range(len(s)):
  if (i%2 == 1) and s[i]%2 == 1:
    count = count + 1

print(count)
# Judge status: Accepted
S = input()
T = input()


def found(i):
    for j in range(len(T)):
        if S[i] == '?' or S[i] == T[j]:
            i += 1
        else:
            return False
    return True

ret = 'UNRESTORABLE'
for i in range(len(S) - len(T), -1, -1):
    if found(i):
        ret = S[:i] + T + S[i + len(T):]
        break
    else:
        i += 1

print(''.join('a' if x == '?' else x for x in ret))
# Judge status: Accepted
A,B = map(int,input().split(" "))
print(A*B)
# Judge status: Wrong Answer
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

x = ni()
tmp = 0
while True:
    add = (x + tmp ** 5) ** (1/5)
    sub = (x - tmp ** 5) ** (1/5)
    if add- round(add) < 10e-6:
        print(round(add), tmp)
        break
    if sub- round(sub) < 10e-6:
        print(round(sub), -tmp)
        break
    tmp += 1
# Judge status: Wrong Answer
a,b = map(int,input().split())

if a==b:
    print('yes')
else:
    print('No')
# Judge status: Accepted
n,k=map(int,input().split())
ar=list(map(int,input().split()))
def cnt(x):
	s=0
	for i in ar:
		if i>x:
			s+=(i-1)//x
	return s
l=0
r=10**9
while l<r-1:
	m=(l+r)//2
	c=cnt(m)
	if c>k:
		l=m
	else:
		r=m
print(r)
# Judge status: Wrong Answer
a = int(input())

s = input()

if a >= 3200:
    print("s")
elif a <= 3200:
    print("red")
# Judge status: Wrong Answer
import math
N = int(input())
num1 = math.floor(N / 1.08)
num2 = math.ceil(N / 1.08)
num3 = math.floor(num1 * 1.08)
num4 = math.floor(num2 * 1.08)
if N == num3 or N == num4:
  print(N)
else:
  print(':(')
# Judge status: Accepted
# input
N = int(input())

Cap = []
append = Cap.append
for i in range(5):
    append(int(input()))

# check
total = 0
citys = [N] + ([0] * 5)

bottleneck = min(Cap)
print((N + bottleneck - 1) // bottleneck + 4)
# Judge status: Accepted
n, m = map(int, input().split())
dic = {}
ans = [0]*m
for i in range(m):
  p, y = map(int, input().split())
  dic.setdefault(p, []).append([y, i])
for i, j in dic.items():
  j = sorted(j)
  for k, l in enumerate(j):
    ans[l[1]]= str(i).zfill(6) + str(k + 1).zfill(6)
for i in range(len(ans)):
  print(ans[i])
# Judge status: Accepted
x,n = map(int,input().split())
i = 0
while x >= n ** i:
  i += 1
  
print(i)
# Judge status: Wrong Answer
n, k = map(int, input().split())
h =  list(map(int, input().split()))

def solve():
    global n, k, h
    if n <= k:
        return 0
    s = sum(h)
    h = sorted(h, reverse=True)
    for i in range(k):
        print(h[i])
        s -= h[i]
    return s

print(solve())
# Judge status: Accepted
n = input()
if n[0]==n[1] or n[1]==n[2] or n[2]==n[3]:
    print("Bad")
else:
    print("Good")
# Judge status: Accepted
from collections import Counter
def f(n):
    if n<2:
        return 0
    return n*(n-1)//2
N = int(input())
A = list(map(int, input().split()))
cnt = Counter(A)
ans = 0
for c in cnt.values():
    ans += f(c)

for a in A:
    print(ans-cnt[a]+1)
# Judge status: Accepted
n = int(input())

ck = 0
for i in range(1,10):
  if(n%i):
    continue
  else:
    if(n/i <= 9):
      ck = 1
      break
if(ck):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
from collections import deque

n  = int(input())
a = list(map(int,input().split()))
b = deque()
for i in range(1,n+1):
  if i%2 != 0:
    b.append(a[i-1])
  else:
    b.appendleft(a[i-1])
    
    
b = list(map(str,b))
B = " ".join(b)

if n%2 != 0:
  print(B[::-1])
else:
  print(B)
# Judge status: Wrong Answer
a, b = map(int, input().split())

a_min = a * 100 / 8
a_max = (a + 1) * 100 / 8

b_min = b * 100 / 10
b_max = (b + 1) * 100 / 10

out = max(a_min, b_min)
print(int(out) if (out < a_max) & (out < b_max) else -1)
# Judge status: Wrong Answer
N, M = map(int, input().split())
ab = [[int(i) for i in input().split()] for i in range(N)]
cd = [[int(i) for i in input().split()] for i in range(M)]
ans = []


for a, b in ab:
    num = float('inf')
    check = 0
    for i in range(M):
        if num > (a - cd[i][0]) ** 2 + (b - cd[i][1]) ** 2:
            num = (a - cd[i][0]) ** 2 + (b - cd[i][1]) ** 2
            check = i + 1
    ans.append(check)

for i in ans:
    print(i)
# Judge status: Accepted
def e_payment_greedy():
    N = [int(i) for i in list(input())]
    s = N[::-1] + [0]  # [-d-1]: 最終的に 10**d 円札を何枚受渡ししたかが格納される

    for i in range(len(N)):
        if s[i] >= 6 or (s[i] == 5 and s[i + 1] >= 5):
            s[i] = 10 - s[i]
            s[i + 1] += 1
    return sum(s)

print(e_payment_greedy())
# Judge status: Wrong Answer
N = int(input())
A = [int(input()) for i in range(N)]
cnt = 0

if 2 not in A:
  print(-1)

a = A[0]
while a > 2: 
  a = A[a-1]
  cnt += 1
  if a == 1:
    print(-1)
    exit()
print(cnt+1)
# Judge status: Accepted


import numpy as np

input()
a=np.array(input().split(),dtype=np.int64)
ans=0

while(a%2==0).all():
    a//=2
    ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
S = [0]*N
for i in range(N):
    S[i] = ''.join(sorted(str(input())))
answer = 0
numdic = {}
for i in range(N):
    if S[i] in numdic:
        answer += numdic[S[i]]
        numdic[S[i]] +=1
        
    else:
        numdic[S[i]] = 1
    
print(answer)
# Judge status: Accepted
x = list(map(int, input().split()))
for i in range(int(input())):
    x.sort()
    x[-1]=x[-1]*2
print(sum(x))
# Judge status: Accepted
h, n = map(int, input().split())
a = list(map(int, input().split()))
if sum(a) >= h:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
ans=-1

for i in range(1,N+1):
       if int( i*1.08) == N:
            ans = i
            
if ans == -1:
    print(':(')
else:
    print(ans)
# Judge status: Accepted
n,m,x=map(int,input().split())
ca = [list(map(int,input().split())) for _ in range(n)]

ans = 1234567890123

for bit in range(1<<n):
    syu = [0]*m
    cost = 0
    for i in range(n):
        if (bit>>i)&1:
            cost += ca[i][0]
            for j in range(1,m+1):
                syu[j-1] += ca[i][j]
    ok = True
    if all(a >= x for a in syu):
        ans = min(ans,cost)
print(ans if ans != 1234567890123 else -1)
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))
ans = 0
x = dict()
for i in range(N):
    if a[i] in x:
        x[a[i]] += 1
    else:
        x[a[i]] = 1
for idx in x:
    b = x[idx] - idx
    if b<0:
        ans += x[idx]
    else:
        ans += b 
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

point = {"r" : P, "s" : R, "p" : S}
ans = 0
flag = 0
for i in range(K) :
    flag = T[i]
    ans += point[T[i]]
    while True :
        i += K
        if i >= N :
            break
        if T[i] != flag :
            ans += point[T[i]]
            flag = T[i]
        else :
            flag = 0

print(ans)
# Judge status: Wrong Answer
#!/usr/bin/env python3
a,b,c,d=map(int,input().split())
if b>0 and d>0:
    print(b*d)
elif b<0 and c>0:
    print(b*c)
elif a>0 and d<0:
    print(a*d)
else:
    print(a*c)
# Judge status: Accepted
from collections import defaultdict

stairs = []
steps = []
MOD = 1000000007

n, m = map(int, input().split())
stairs = {int(input()):True for _ in range(m)}

step = defaultdict(int)
step[0] = 1

for i in range(n):
    if i in stairs.keys():
        step[i] = 0
    else:
        step[i+1] = (step[i] + step[i+1]) % MOD
        step[i+2] = (step[i] + step[i+2]) % MOD

print(step[n])
# Judge status: Wrong Answer
n = int(input())
a=1
b=1
c=1
num=0
s=1
for d in range(1,c+1) :
  for e in range(1,b+1) :
    for f in range(1,c+1) :
      for x in range(1,max(a,b,c)+1) :
        if n%x == 0 :
          s=x
      num += s
      s=1
print(str(num))
# Judge status: Accepted
s = input()
cnt = [s.count("a"), s.count("b"), s.count("c")]
cnt.sort()

ans = "YES"
if cnt[1]-cnt[0] >=2 or cnt[2]-cnt[0] >= 2 or cnt[2]-cnt[1] >= 2:
   ans ="NO"
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
D=set(map(str,input().split()))
for i in range(n,10*n):
    num=set(list(str(i)))
    if i>=n and len(D&num)==0:
        print(i)
        exit()
# Judge status: Accepted
N=int(input())
odd = N//2+(N%2)

print(odd/N)
# Judge status: Accepted
N = int(input())

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

#print(A)
#print(B)

x=y=0
for i in range(len(A)):
  a, b = A[i], B[i]

  if a<b: x+=(b-a)//2*2
  if a>b: y+=a-b

ans="Yes" if x >= y*2 else "No"
print(ans)
# Judge status: Accepted
l=list(map(int,input().split()))
l.sort()
k=int(input())
print(l[0]+l[1]+l[2]*(2**k))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
sa,sb = sum(A),sum(B)
if sa > sb:
    print('No')
    exit()

x = y = 0
for a,b in zip(A,B):
    if a < b:
        x += (b-a+1)//2
        y += (b-a)%2
    elif a > b:
        y += a-b

if x>sb-sa or y>sb-sa:
    print('No')
else:
    print('Yes' if x>=y else 'No')
# Judge status: Accepted
import collections
import itertools
N=int(input())
di = dict()
l = list()
for i in range(N):
    l.append( input())

c = collections.Counter(l)
ct = c.most_common()
m = ct[0][1]
li = list()
for t in ct:
    if m == t[1]:
        li.append(t[0]) 
    else:
        break
lis = sorted(li)
for s in lis:
    print(s)
# Judge status: Wrong Answer
from collections import deque
n,m = map(int, input().split())

graph = [[] for _ in range(n+1)]
for i in range (m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

#print(graph)

dist = [-1] * (n+1)
dist[0] = 0
dist[1] = 0

d = deque()
d.append(1)

#print(d)

while d:
    v = d.popleft()
    for i in graph[v]:
        if dist[i] != -1:
            continue
        dist[i] = dist[v] +1
        d.append(i)

ans = dist[1:]
print(*ans, sep="\n")
# Judge status: Accepted
import copy,collections
N = int(input())
s = ['a']
for i in range(2,N+1):

    tmp = copy.copy(s)
    tmp2 = []
    for tm in tmp:
        tc = collections.Counter(tm)
        lc = len(tc.values())
        for j in range(1,lc+2):
            tmp2.append(tm+chr(96+j))
    s = copy.copy(tmp2)
for sa in s:
    print(sa)
# Judge status: Wrong Answer
import re
s=input()
h=re.fullmatch(r'2019/(\d+)/(\d+)',s)
if h.groups(1)=='04'or h.groups(1)=='03'or h.groups(1)=='02'or h.groups(1)=='01':
    print('Heosei')
else:
    print('TBD')
# Judge status: Accepted
k = int(input())
s = input()
print(s if len(s) <= k else (s[:k] + '...'))
# Judge status: Wrong Answer
a = int(input())
b = a / 2
c = a % 2
if c == 1 :
    b = b + 0.5
print(b)
# Judge status: Accepted
import copy
s = input()
t = input()
for i in range(len(s)-len(t)+1):
  s1 = copy.deepcopy(s[len(s)-len(t)-i:len(s)-i])
  for j in range(len(t)):
    if t[j]==s1[j]:
      continue
    elif s1[j]=="?":
      s2 = list(s1)
      s2[j]=t[j]
      s1 = "".join(s2)
    else:
      break
  else:
    s3 = s[:len(s)-len(t)-i].replace("?","a")+s1+s[len(s)-i:].replace("?","a")
    print(s3)
    exit()
print("UNRESTORABLE")
# Judge status: Wrong Answer
a,b = map(int, input().split())
if (b<a):
      print(-1)
else:
      print(a*b)
# Judge status: Accepted
n = int(input())


def prime_factorization(n):
    pmax = int(n ** 0.5 // 1) + 1

    factors = {}
    for p in range(2, pmax + 1):
        while n % p == 0:
            factors[p] = factors.get(p, 0) + 1
            n //= p
    if n != 1:
        factors[n] = factors.get(n, 0) + 1

    return factors


factors = prime_factorization(n)

answer = 0
for power in factors.values():
    n = 1
    while (n + 1) * (n + 2) // 2 <= power:
        n += 1
    answer += n



print(answer)
# Judge status: Accepted
import itertools
s = list(input())
s1 = list(itertools.dropwhile(lambda x: x != 'A',s))
s2 = list(itertools.dropwhile(lambda x: x != 'Z',s1[::-1]))
print(len(s2))
# Judge status: Wrong Answer
color=input()
iro=color.split(" ")

i=len(iro)

print(str(i))
# Judge status: Wrong Answer
l = [0,1]
n = int(input())
for i in range(2,n+1):
    l.append(l[i-1] + l[i-2])
print(l[-1])
# Judge status: Accepted
n=input()


x=int(n)*800
y=int(n)//15*200


print(x-y)
# Judge status: Accepted
s = input()
a = s.count("1")
print(a)
# Judge status: Wrong Answer
n = int(input())
mod = 10**9+7

ans = pow(10,n,mod)
ans += pow(9,n,mod)*2
ans -= pow(8,n,mod)

print(ans%mod)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
A=[0]+A
import math

L=[0 for i in range(N+2)]
R=[0 for i in range(N+2)]
for i in range(0,N+1):
  L[i+1]=math.gcd(L[i],A[i])
for i in range(N,-1,-1):
  R[i]=math.gcd(R[i+1],A[i])

M=[0 for i in range(N+1)]
for i in range(1,N):
  M[i]=math.gcd(L[i],R[i+1])
print(max(M))
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())
print((a + b) * h //2)
# Judge status: Wrong Answer
n,k = map(int,input().split())
a = list(map(int,input().split()))
l = 0
r = 10 ** 9

while r-l > 1 :
    m = (l+r)//2 
    b = list(map(lambda x: -(-x//m) - 1 ,a))
    ans = sum(b)
    if ans <= k :
        r = m
    else :
        l = m
    print(l,r)

print(r)
# Judge status: Accepted
a, b = map(int, input().split())
print(2 * max(a, b) - 1) if abs(a - b) >= 2 else print(a + b)
# Judge status: Accepted
s = list(input())
K = int(input())

for i in range(len(s)):
    if s[i] == 'a':
        continue
    n = ord('z') - ord(s[i]) + 1
    if n <= K:
        K -= n
        s[i] = 'a'

K %= 26
s[-1] = chr((ord(s[-1]) - ord('a') + K) % 26 + ord('a'))

print(''.join(s))
# Judge status: Wrong Answer
a, v = map(int,input().split())
b, w = map(int,input().split())
t= int(input())

l = b-a
dv = v-w
if dv == 0:
    if l == 0:
        print("YES")
    else:
        print("NO")
elif l > 0:
    if dv*t > l:
        print("YES")
    else:
        print("NO")
else:
    if dv*t < l:
        print("YES")
    else:
        print("NO")
# Judge status: Wrong Answer
num=(int)(input())
n=num//100
amari=num%100
if num <= 99 or amari / n > 6:
  print(0)
else:
  print(1)
# Judge status: Accepted
a, b, x = map(int, input().split())

# a = p*x + r, b = q*x + s
p = a // x
r = a % x
q = b // x
s = b % x

res = q - p

if r == 0:
  res += 1

print(res)
# Judge status: Accepted
K = int(input())
S = input()

if len(S) <= K:
  print(S)
else :
  print(S[:K] + '...')
# Judge status: Accepted
A, B = map(int, input().split())
if A - B >= 2:
    print(A+A-1)
elif B - A >= 2:
    print(B+B-1)
else:
    print(A+B)
# Judge status: Accepted
s=input()
x=0
y=0
u=int(s[0:2])
d=int(s[2:])

if 1<=u and u<=12:
    x=1
else:
    x=-1
if 1<=d and d<=12:
    y=1
else:
    y=-1
    
if x*y==1 and x<0:
    print('NA')
elif x*y==1:
    print('AMBIGUOUS')
elif x==1 and y==-1:
    print('MMYY')
else:
    print('YYMM')
# Judge status: Wrong Answer
import sys
import fractions


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, readline().split()))
    a = [v >> 1 for v in list(map(int, readline().split()))]
    lcm = a[0]
    for v in a[1:]:
        lcm = lcm * v // fractions.gcd(lcm, v)
        if lcm > m:
            print(0)
            exit()
    print(m // lcm - m // (lcm * 2))


if __name__ == '__main__':
    solve()