Harryxun/stf_run huggingface dataset:
A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])
d=int(A[1])*10+int(A[0])
e=int(B[1])*10+int(B[0])
count_small=0
count_large=0
if a==b:
    for i in range(0,9):
        if a*1000+d+i*100>=int(A) and b*1000+e+i*100<=int(B):
            count_small+=1
            ans=count_small
else:
    for i in range(0,9):
        if a*1000+d+i*100>=int(A):
            count_small+=1
        if b*1000+e+i*100<=int(B):
            count_large+=1
    ans=(b-a-1)*10+count_small+count_large
print(ans)


### FIXED CODE ###

A,B=input().split()
a=int(A[0])*10+int(A[1])
b=int(B[0])*10+int(B[1])
d=int(A[1])*10+int(A[0])
e=int(B[1])*10+int(B[0])
count_small=0
count_large=0
if a==b:
    for i in range(0,10):
        if a*1000+d+i*100>=int(A) and b*1000+e+i*100<=int(B):
            count_small+=1
    ans=count_small
else:
    for i in range(0,10):
        if a*1000+d+i*100>=int(A):
            count_small+=1
        if b*1000+e+i*100<=int(B):
            count_large+=1
    ans=(b-a-1)*10+count_small+count_large
print(ans)
INF = 10**10
arr = [10,2,5,5,4,5,6,3,7,6]
N,M = map(int,input().split())
src = sorted(list(map(int,input().split())))

dp = [-INF]*(N+1)
dp[0] = 0
for i in range(N):
    for j in src:
        if i + arr[j] <= N:
            dp[i+arr[j]] = max(dp[i+arr[j]],dp[i] + 1)
dim = dp[N]
ans  = ''
while(dim > 0):
    for i in src[::-1]:
        if dp[N-arr[i]] + 1 == dp[N]:
            ans += str(i)
            N -= arr[i]
            dim -= 1
            break
print(ans)

### FIXED CODE ###

INF = 10**10
arr = [INF,2,5,5,4,5,6,3,7,6]
N,M = map(int,input().split())
src = sorted(list(map(int,input().split())))

dp = [-INF]*(N+1)
dp[0] = 0
for i in range(N):
    for j in src:
        if i + arr[j] <= N:
            dp[i+arr[j]] = max(dp[i+arr[j]],dp[i] + 1)
dim = dp[N]
ans  = ''
while(dim > 0):
    for i in src[::-1]:
        if N >= arr[i] and dp[N-arr[i]] + 1 == dp[N]:
            ans += str(i)
            N -= arr[i]
            dim -= 1
            break
print(ans)
n = int(input())
ans = 0
P = list(range(1,n+1))
for i in range(1, n+1):
  if i == n:
    break
  ans += i%(P[i])
print(ans)  

### FIXED CODE ###

n = int(input())
print(n*(n-1)//2)
A, B, K = map(int, input().split())

a = list(range(A,B+1))
if B-A+1 <= 2*K:
    for ans in a:
        print(ans)
else:
    for ans in a[:K]:
        print(ans)
    for ans in a[-K:]:
        print(ans)


### FIXED CODE ###

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

if B-A+1 <= 2*K:
    for ans in range(A,B+1):
        print(ans)
else:
    for ans in range(A, A+K):
        print(ans)
    for ans in range(B-K+1, B+1):
        print(ans)
N, M = map(int,input().split())
A = [[1,int(a)] for a in input.split()]
BC = A + [list(map(int,input().split())) for _ in range(M)]

BC.sort(key=lambda x:x[1], reverse=True)

i = 0
ans = 0
for B,C in BC:
    if i + B <= N:
        ans += B*C
    else:
        ans += (N - i) * C

print(ans)

### FIXED CODE ###

N, M = map(int,input().split())
A = [[1,int(a)] for a in input().split()]
BC = A + [list(map(int,input().split())) for _ in range(M)]

BC.sort(key=lambda x:x[1], reverse=True)

i = 0
ans = 0
for B,C in BC:
    if i + B <= N:
        ans += B*C
        i += B
    else:
        ans += (N - i) * C
        break

print(ans)
# coding: utf-8

import numpy as np

N, M = list(map(int, input().split(' ')))
A = [int(input()) for _ in range(N)]
B = [int(input()) for _ in range(M)]
scores = [0 for _ in range(N)]

for j in range(M):
    for i in range(N):
        if A[i] <= B[j]:
            scores[i] += 1
            break

print(np.argmax(scores) + 1)


### FIXED CODE ###

# coding: utf-8

N, M = list(map(int, input().split(' ')))
A = [int(input()) for _ in range(N)]
B = [int(input()) for _ in range(M)]
scores = [0 for _ in range(N)]

for j in range(M):
    for i in range(N):
        if A[i] <= B[j]:
            scores[i] += 1
            break

max_i, max_val = 0, 0
for i in range(N):
    if scores[i] > max_val:
        max_val = scores[i]
        max_i = i
print(max_i + 1)
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
meanx = (T - A)/0.006
H = H - meanx
print(index(min(H)))

### FIXED CODE ###

N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
 
res = [abs(T-h*0.006-A) for h in H]
print(res.index(min(res))+1)
n, k = map(int, input().split())
a = [0]*n
for i in range(n):
  a[i] = int(input())

a.sort()

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

print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
h = []
for _ in range(n):
    h.append(int(input()))

h.sort()
ans = []
for i in range(n-k+1):
    ans.append(h[i+k-1]-h[i])
print(min(ans))
#!/usr/bin/env python3

N = int(input())
# S = input()
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
mod = 10 ** 9
from functools import reduce
from fractions import gcd

def main():
    T = sorted(list(set([int(input()) for _ in range(N)])))
    if len(T) == 1:
        print(T[0])
        exit()
    ans = (T[0] * T[1]) // gcd(T[0], T[1])
    for i in range(len(T) - 2):
        ans = int(ans / gcd(ans, T[i + 2]) * T[i + 2])
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

#!/usr/bin/env python3

N = int(input())
# S = input()
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
mod = 10 ** 9
from functools import reduce
from fractions import gcd

def main():
    T = sorted(list(set([int(input()) for _ in range(N)])))
    if len(T) == 1:
        print(T[0])
        exit()
    ans = (T[0] * T[1]) // gcd(T[0], T[1])
    for i in range(len(T) - 2):
        ans = (ans * T[i + 2]) // (gcd(ans, T[i + 2]))
    print(ans)

if __name__ == "__main__":
    main()
n = int(input())
s = input()
raw = []
for i in range(n):
  raw.append(s[i:])
raw.sort()
#print(raw)
if all( raw[i-1][0] != raw[i][0] for i in range(1,n)):
  ans = 0
else:
  ans = 1
  for i in range(1,n):
    one = raw[i-1]
    two = raw[i]
    lone = len(one)
    ltwo = len(two)
    stop = min(lone,ltwo,abs(lone-ltwo))
    if ans > stop:
      pass
    else:
      for i in range(ans,stop):
        if one[i] == two[i]:
          ans += 1
print(ans)

### FIXED CODE ###

s = input()
if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
a,b = map(decimal,input().split())
print(int(a*b))

### FIXED CODE ###

a,b = input().split()
na = int(a)
nb100 = (int(b[0])*100+int(b[2:]))
ans = na*nb100
print(ans//100)
n, q = map(int,input().split())
cnt = [0] * (n+1)
import sys
sys.setrecursionlimit(10**6)
import numpy as np
tree = np.zeros((n+1, n+1))
child = [0] * (n+1)
for i in range(n-1):
    a, b = map(int,input().split())
    tree[a][b] = 1
    tree[b][a] = 1
def dfs(i):
    global child
    child[i] = []
    if np.all(tree[i]):
        return
    for j in range(n+1):
        if tree[i][j] == 1:
            tree[j][i] = 0
            child[i].append(j)
            dfs(j)
    return

dfs(1)
#print(child)
for _ in range(q):
    p,x = map(int,input().split())
    cnt[p] += x
def plus(c):
    global cnt
    if child[c] == []:
        return
    for target in child[c]:
        cnt[target] += cnt[c]
        plus(target)
    return
plus(1)
print(*cnt[1:])

### FIXED CODE ###

n, q = map(int,input().split())
cnt = [0] * (n+1)
tree = [[] for _ in range(n+1)]
seen = [0] * (n+1)
todo = [1]
for i in range(n-1):
    a, b = map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
for _ in range(q):
    p,x = map(int,input().split())
    cnt[p] += x

while todo != []:
    i = todo.pop()
    seen[i] = 1
    for j in tree[i]:
        if seen[j] == 0:
            todo.append(j)
            cnt[j] += cnt[i]
print(*cnt[1:])
N, M = map(int, input().split())
ans = [-1]*N
for i in range(M):
    s, c = map(int, input().split())
    if ans[s-1] == -1:
        ans[s-1] = c
    elif ans[s-1] != c:
        print(-1)
        break

print(ans)
if len(ans) == 1:
    print(0)
else:
    if ans[0] == 0:
        ans = [-1]
    elif ans[0] == -1:
        ans[0] = 1
    for i in range(M):
        if ans[i] == -1:
            ans[i] = 0
    print(int(''.join(map(str,ans))))

### FIXED CODE ###

N, M = map(int, input().split())
ans = [-1]*N
for i in range(M):
    s, c = map(int, input().split())
    if ans[s-1] == -1:
        ans[s-1] = c
    elif ans[s-1] != c:
        print(-1)
        exit()
if N == 1:
    if ans[0] == -1:
        print(0)
    else:
        print(int(''.join(map(str,ans))))
else:
    if ans[0] == 0:
        print(-1)
        exit()
    elif ans[0] == -1:
        ans[0] = 1
    for i in range(N):
        if ans[i] == -1:
            ans[i] = 0
    print(int(''.join(map(str,ans))))
n=int(input())
for i in range(1,n):
  a=i*i
  if a>n:
    a= (i-1)*(i-1)
    break
print(a)

### FIXED CODE ###

n=int(input())
for i in reversed(range(1, n+1)):
  if (i ** .5).is_integer():
    print(i)
    break
import bisect

N,M,V,P = map(int, input().split())
A = [int(a) for a in input().split()]

cnt = 0
A.sort()
    
if V <= P:
    for i in range(N-P):
        if A[i]+M < A[N-P]:
            cnt += 1
        else:
            break
else:
    for i in range(N-P):
        if i+P >= V:
            if A[i]+M < A[N-P]:
                cnt += 1
            else:
                break
        else:
            num = M*V-M*(i+P)#さばかないといけない数
            j = bisect.bisect_left(A, A[i]+M)
            if A[j] == A[i]+M:
                j -= 1
            j = min(j, N-P)
            if j > V-P:
                cnt += 1
                break
            L = A[i+1:j+1]
            t = 0
            while L[V-P-i-1] < A[i]+M and num > 0:
                s = A[i]+M-L[V-P-i-1]
                for k in range(V-P-i):
                    L[i] += s
                L.sort()
                num -= s*(V-P-i)
            if num > 0:
                cnt += 1
            else:
                break
print(N-cnt)

### FIXED CODE ###

N,M,V,P = map(int, input().split())
A = [int(a) for a in input().split()]

A.sort(reverse=True)

S = [0]*N
t = 0
for i in range(N):
    t += A[i]
    S[i] = t

s = M*(N-V)
l = P
r = N
if P == 1:
    a = 0
else:
    a = S[P-2]
while l < r:
    m = (r-l)//2 + l
    if A[P-1]-M > A[m]:
        r = m
        continue
    if S[m-1]-a-(m-P+1)*A[m] > s:
        r = m
        continue
    l = m+1
    
print(l)
a,b,c=map(int,input().split())
s=list[b]
print(a+b[0]+c)

### FIXED CODE ###

a,b,c = map(str,input().split())
B = list(b)
print("A"+B[0]+"C")
l,n=map(int,input().split())
list=[]
for _ in range(n):
    list.append(input())

list.sort()
ans=""
for i in len(list):
    ans+=list[i]
print(ans)

### FIXED CODE ###

n,l=map(int,input().split())
list=[]
for _ in range(n):
    list.append(input())
 
list.sort()
ans=""
for i in list:
    ans+=i
print(ans)
Suits = ['S', 'H', 'C', 'D']
Taro = []
Missing = []
n = input()
for i in range(n):
    Taro.append(input())
for j in range(52):
    card = Suits[j//13] + ' ' + str(j % 13 + 1)
    if card not in Taro:
        Missing.append(card)
print('\n'.join(Missing))

### FIXED CODE ###

Suits = ['S', 'H', 'C', 'D']
Taro = []
Missing = []
n = int(input())
for i in range(n):
    Taro.append(input())
for j in range(52):
    card = Suits[j//13] + ' ' + str(j % 13 + 1)
    if card not in Taro:
        Missing.append(card)
if Missing != []:
    print('\n'.join(Missing))
N, P = map(int, input().split())
if N == 1:
	print(P)
else:
	ans = 1
	for i in range(2, P):
		g = i ** N
		if g > P:
			break
		if P % g == 0:
			ans = i
	print(ans)


### FIXED CODE ###

import math	
N, P = map(int, input().split())
if N == 1:
	print(P)
else:
	ans = 1
	for i in range(2, P):
		if N * math.log(i) > math.log(P):
			break
		if P % (i ** N) == 0:
			ans = i
	print(ans)
def z_algo(s):
    z = [0]*len(s)
    n = len(s)
    L = 0
    R = 0
    for i in range(1, n):
        if i > R:
            L = i
            R = i
            l = 0
            while l + L < n and s[l] == s[l + i]:
                l += 1
            z[i] = l
            if l > 0:
                R = L + l - 1
        else:
            k = i - L
            right_len = R - i + 1
            if z[k] < right_len:
                z[i] = z[k]
            else:
                L = i
                l = R + 1
                while l < n and s[l - L] == s[l]:
                        l += 1
                z[i] = l - L
                R = l - 1
    return z

ans = 0
N = int(input())
S = input()

for i in range(N):
    LCP = Z_algo(S[i:])
    for j, l in enumerate(LCP):
        tmp = min(l, j)
        ans = max(ans, tmp)
print(ans)

### FIXED CODE ###

def Z_algo(S):
    n = len(S)
    LCP = [0]*n
    i = 1
    j = 0
    c = 0#最も末尾側までLCPを求めたインデックス
    for i in range(1, n):
        #i番目からのLCPが以前計算したcからのLCPに含まれている場合
        if i+LCP[i-c] < c+LCP[c]:
            LCP[i] = LCP[i-c]
        else:
            j = max(0, c+LCP[c]-i)
            while i+j < n and S[j] == S[i+j]: j+=1
            LCP[i] = j
            c = i
    LCP[0] = n
    return LCP
  
ans = 0
N = int(input())
S = input()
for i in range(N):
    LCP = Z_algo(S[i:])
    for j, l in enumerate(LCP):
        tmp = min(l, j)
        ans = max(ans, tmp)
print(ans)
a,b=input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:print('YES')
else:print('NO')

### FIXED CODE ###

a,b=input(),input()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:print('YES')
else:print('NO')
from sys import stdin

n,q = [int(x) for x in stdin.readline().rstrip().split()]
s = stdin.readline().rstrip()
li = [list(map(int,stdin.readline().rstrip().split())) for _ in range(q)]

for i in range(q):
    kotoba = s[li[i][0]-1:li[i][1]]
    kai = kotoba.count("AC")
    print(kai)

### FIXED CODE ###

from sys import stdin

s = stdin.readline().rstrip()

li = ["A","T"]
li2 = ["C","G"]

if s in li:
    li.pop(li.index(s))
    print(li[0])
else:
    li2.pop(li2.index(s))
    print(li2[0])
n, k = input()
re = ""
if n - k > 0:
    re.jpin("YES")
else:
    re.jpin("NO")
print(re)

### FIXED CODE ###

n, k = (int(i) for i in input().split())
re = ""
if (2 * k - 1) <= n:
    re = "YES"
else:
    re = "NO"
print(re)
n=int(input())
a=0
x=int(n**0.5)
for m in range(1,x+1):
    a+=m*(m+n//m)*(n//m+1-m)
print(a-x*(1+x)//(1-x)**4)

### FIXED CODE ###

import math
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def numdiv(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table
N = i()
era = numdiv(N)
ans = 0
for i in range(1,N+1):
    ans += era[i]*i
print(ans)
import sys
N,M = map(int,input().split())
if M == 0:
	print('0 0')
	sys.exit()


p = [0]*M#問題の番号
s = [0]*M#結果 AC,WA

for i in range(M):
	p[i],s[i] = input().split()

cor_count = 0
pen_count = 0
AC_list = []

for i in range(M):
	if not p[i+1] in AC_list:
		if s[i+1] == 'AC':
			AC_list.append(p[i+1])
		else:
			pen_count += 1

#print(AC_list)
cor_count = len(set(AC_list))
if M != 0:
	print(cor_count,pen_count)





### FIXED CODE ###


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

AC = 0
WA = 0


was = [0]*(N+1)
acs = [0]*(N+1)

for i in range(M):
	p,s = input().split()
	p = int(p)

	if s == "AC":

		if acs[p] == 0:

			AC += 1
			WA += was[p]
			acs[p] = 1
			
	else:
		was[p] += 1

print(AC,WA)
import fractions
n = int(input())
half = int(fractions.sqrt(n))

ans = []
for i in range(half, 0, -1):
    if n%i==0:
        ans.append(max(len(str(i)), len(str(n//i))))
print(min(ans))

### FIXED CODE ###

import math
n = int(input())
half = int(math.sqrt(n))

ans = []
for i in range(half, 0, -1):
    if n%i==0:
        ans.append(max(len(str(i)), len(str(n//i))))
print(min(ans))
n,m=map(int,input().split())
hl=input().split()
shl=[int(x) for x in hl]
vl=set()
for i in range(m):
    a,b=map(int,input().split())
    if shl[a-1]>shl[b-1]:
        vl.add(b-1)
    elif shl[a-1]<shl[b-1]:
        vl.add(a-1)
    else:
        vl.add(a-1)
        vl.add(b-1)
    print(vl)
lshl=len(shl)
lvl=len(vl)
ans=lshl-lvl
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
hl=input().split()
shl=[int(x) for x in hl]
vl=set()
for i in range(m):
    a,b=map(int,input().split())
    if shl[a-1]>shl[b-1]:
        vl.add(b-1)
    elif shl[a-1]<shl[b-1]:
        vl.add(a-1)
    else:
        vl.add(a-1)
        vl.add(b-1)
lshl=len(shl)
lvl=len(vl)
ans=lshl-lvl
print(ans)
class UnionFind:
    def __init__(self,N):
        self.par =[-1 for i in range(N)]
    def find(self,x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def unite(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x==y:
            return
        if self.par[x] > self.par[y]:
            x,y = y,x
        self.par[x] +=self.par[y]
        self.par[y] = x

    def size(self,x):
        if self.par[x] < 0:
            return -self.par[x]
        else:
            self.par[x] = self.size(self.par[x])
            return self.par[x]
    def same(self,x,y):
        return self.find(x)==self.find(y)

N,M,K=map(int,input().split(' '))
Friend = UnionFind(N)
pull = [-1] * N
for i in range(M):
    a,b = map(int,input().split(' '))
    Friend.unite(a-1,b-1)
    pull[a-1] -= 1
    pull[b-1] -= 1
for i in range(K):
    c,d=map(int,input().split(' '))
    if Friend.same(c-1,d-1):
        pull[c-1] -=1
        pull[d-1] -=1
print(' '.join([str(Friend.size(i)+pull[i]) for i in range(N)]))

### FIXED CODE ###

class UnionFind:
    def __init__(self,N):
        self.par =[-1 for i in range(N)]
    def find(self,x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def unite(self,x,y):
        x = self.find(x)
        y = self.find(y)
        if x==y:
            return
        if self.par[x] > self.par[y]:
            x,y = y,x
        self.par[x] +=self.par[y]
        self.par[y] = x

    def size(self,x):
        return -self.par[self.find(x)]
    def same(self,x,y):
        return self.find(x)==self.find(y)

N,M,K=map(int,input().split(' '))
Friend = UnionFind(N)
pull = [-1] * N
for i in range(M):
    a,b = map(int,input().split(' '))
    Friend.unite(a-1,b-1)
    pull[a-1] -= 1
    pull[b-1] -= 1
for i in range(K):
    c,d=map(int,input().split(' '))
    if Friend.same(c-1,d-1):
        pull[c-1] -=1
        pull[d-1] -=1
print(' '.join([str(Friend.size(i)+pull[i]) for i in range(N)]))
import math
n,*x=map(int,open(0).read().split())
x.sort()
a=[i-j for i,j in zip(x[1:],x[:-1])]
set(a)
a.sort()
b=[i for i in a if i%a[0]]
b.append(a[0])
if len(b)==1:
    print(*b)
else:
    ans=b[0]
    for i,j in zip(b[1:],b[:-1]):
        ans=min(ans,gcd(i,j))
    print(ans) 

### FIXED CODE ###

import fractions
n,*x=map(int,open(0).read().split())
x.sort()
a=[i-j for i,j in zip(x[1:],x[:-1])]
set(a)
a.sort()
b=[i for i in a if i%a[0]]
b.append(a[0])
if len(b)==1:
    print(*b)
else:
    ans=b[0]
    for i in b[1:]:
        ans=fractions.gcd(ans,i)
    print(ans)
args = [input() for _ in range(2)]

N = int(args[0])
H = [int(l) for l in args[1].split()]

import numpy as np

H = np.array(H)

def get_max_len(arr):
  
  max_ind = np.argmax(arr)
  next_ind = max_ind + 1
  val = arr[max_ind]
  if next_ind >= len(arr):
    max_len = 0
  else:
    next_val = arr[next_ind]

    while val > next_val:
      val = next_val
      next_ind += 1
      if next_ind >= len(arr):
        break

      next_val = arr[next_ind]
    max_len = next_ind - max_ind - 1
	
  if max_ind >= max_len:
  	tmp_max_len = get_max_len(arr[:max_ind])
  	max_len = max(max_len, tmp_max_len)
  if len(arr[next_ind:]) - 1 > max_len:
  	tmp_max_len = get_max_len(arr[next_ind:])
  	max_len = max(max_len, tmp_max_len)
    
  return max_len

print(get_max_len(H))

### FIXED CODE ###

args = [input() for _ in range(2)]

N = int(args[0])
H = [int(l) for l in args[1].split()]

max_len = 0
val = H[0]
st = 0
for i in range(1, N):
  next_val = H[i]
  if val < next_val:
    max_len = max(max_len, i - st - 1)
    st = i
    if st + max_len >= N:
      break
  val = next_val

if (N != 1) and (i == N - 1):
  max_len = max(max_len, N - 1 - st)
  
print(max_len)
S=input()
if S==Sunny:
  print(Cloudy)
elif S==Cloudy:
  print(Rainy)
else:
  print(Sunny)

### FIXED CODE ###

S=input()
if S=='Sunny':
  print('Cloudy')
elif S=='Cloudy':
  print('Rainy')
else:
  print('Sunny')
N, M = map(int, input().split())
        
G = [[] for i in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    G[a - 1].append(b - 1)
    
dp = [-1] * (N)

def dfs(v):
    if dp[v] != -1:
        return dp[v]
    
    res = 0
    for g in G[v]:
        res = max(res, dfs(g) + 1)
        
    dp[v] = res
    return res

ans = 0
for i in range(N):
    ans = max(ans, dfs(i))
        
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 8)

N, M = map(int, input().split())
        
G = [[] for i in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    G[a - 1].append(b - 1)
    
dp = [-1] * (N)

def dfs(v):
    if dp[v] != -1:
        return dp[v]
    
    res = 0
    for g in G[v]:
        res = max(res, dfs(g) + 1)
        
    dp[v] = res
    return res

ans = 0
for i in range(N):
    ans = max(ans, dfs(i))
        
print(ans)
S=input()
     
    j=0
    for i in range(4):
     if S[i]=="+":
      j=j+1
     else:
      j=j-1
    print(j)

### FIXED CODE ###

S=input()
         
j=0
for i in range(4):
	if S[i]=="+":
		j=j+1
	else:
		j=j-1
print(j)
N = int(input())

if N = 25:
    ans = 'Christmas'

elif N = 24:
    ans = 'Christmas Eve'

elif N = 23:
    ans = 'Christmas Eve Eve'

else:
    ans = 'Christmas Eve Eve Eve'

print(ans)

### FIXED CODE ###

N = int(input())

if N == 25:
    ans = 'Christmas'

elif N == 24:
    ans = 'Christmas Eve'

elif N == 23:
    ans = 'Christmas Eve Eve'

else:
    ans = 'Christmas Eve Eve Eve'

print(ans)
import math
import fractions

# A以上B以下の数でXの倍数の個数
def countX(X) :
    if X > B :
        return 0
    minX = max(math.ceil(A / X),0)
    maxX = max(math.floor(B / X),0)
    return maxX - minX + 1

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

if D == 1 :
  print(z)

ans = B - A + 1

# 最小公倍数
Z = int(C * D / fractions.gcd(C,D))

ans -= countX(C)
ans -= countX(D)
ans += countX(Z)

print(int(ans))



### FIXED CODE ###

import math
import fractions

# A以上B以下の数でXの倍数の個数
def countX(X) :
    if X > B :
        return 0

    minX = (A - 1) // X
    maxX = B // X

    return maxX - minX

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

ans = B - A + 1

# 最小公倍数
Z = int(C * D / fractions.gcd(C,D))

ans -= countX(C)
ans -= countX(D)
ans += countX(Z)

print(int(ans))
import sys
a,b = map(int,input().split())
sum = 0
for i in range(1,1000):
while(a > sum):
	i = 1
    sum += 1
    i += 1
print(sum-a)



### FIXED CODE ###

a,b = map(int,input().split())
ans = 0
N = b - a
for i in range(1,N):
  ans += i
print(ans - a)
from math import gcd
a,b,c,d=map(int,input().split( ))
r1=b-b%c
if a%c!=0:
	l1=a-a%c+c
else:
	l1=a
r2=b-b%d
if a%d!=0:
	l2=a-a%d+d
else:
	l2=a
lcm=(c*d)//gcd(c,d)
r3=b-b%lcm
if a%lcm!=0:
	l3=a-a%lcm+lcm
else:
	l3=a
nc=(r1-l1+c)//c
nd=(r2-l2+d)//d
nlcm=(r3-l3+lcm)//lcm
divi=nc+nd-nlcm
out=b-a+1
if c>a and c>b and d>a and d>b:
	print(0)
else:
	print(out-divi)




### FIXED CODE ###

from fractions import gcd
a,b,c,d=map(int,input().split(' '))
r1=b-b%c
if a%c!=0:
	l1=a-a%c+c
else:
	l1=a
r2=b-b%d
if a%d!=0:
	l2=a-a%d+d
else:
	l2=a
lcm=(c*d)//gcd(c,d)
r3=b-b%lcm
if a%lcm!=0:
	l3=a-a%lcm+lcm
else:
	l3=a
nc=(r1-l1+c)//c
nd=(r2-l2+d)//d
nlcm=(r3-l3+lcm)//lcm
divi=nc+nd-nlcm
out=b-a+1
if c>a and c>b and d>a and d>b:
	print(0)
else:
	print(out-divi)
a,b,c = map(input().split())
d=0
for x in range(a,b+1):
    if c%x==0:d+=1
print(d)

### FIXED CODE ###

a,b,c = map(int,input().split())
d=0
for x in range(a,b+1):
    if c%x==0:d+=1
print(d)
N = int(input())
a = list(map(int, input().split()))
bol = 0
count =0

while(1):
    for num  in a:
	if num  % 2 == 1:
	    bol = 1

    if bol == 0:
	a = [ i	/2 for i in a]
	count += 1
    else :
	break

print(count)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
bol = 0
count =0

while(1):
  for num  in a:
    if num  % 2 == 1:
      bol = 1

  if bol == 0:
        a = [ i	/2 for i in a]
        count += 1
  else:
          break

print(count)