Harryxun/stf_run huggingface dataset:
import bisect
from collections import deque
n = int(input())
a = [int(i) for i in input().split()]


a_sum = [0]
for i in range(n):
    a_sum.append((a_sum[-1]+a[i]))

val = deque()
cnt = deque()
for i in range(n+1):
    # idx = bisect.bisect_left(val, a_sum[i])
    idx = 0
    if len(val) > idx and val[idx] == a_sum[i]:
        cnt[idx] += 1
    else:
        val.insert(idx, a_sum[i])
        cnt.insert(idx, 1)

ans = 0
for i in range(len(cnt)):
    ans += cnt[i]*(cnt[i]-1)//2

print(ans)

### FIXED CODE ###

from collections import Counter

n = int(input())
a = [int(i) for i in input().split()]

a_sum = [0]
for i in range(n):
    a_sum.append((a_sum[-1]+a[i]))

cnt = Counter(a_sum)

ans = 0
for v in cnt.values():
    ans += v*(v-1)//2

print(ans)
N,M=(int(x) for x in int(input().split()))
L=0
R=N
for i in range(M):
  Li,Ri=(int(x) for x in int(input().split()))
  L=Li if Li>L 
  R=Ri if Ri<R
print(Ri-Li+1)

### FIXED CODE ###

N,M=(int(x) for x in input().split())
L=0
R=N
for i in range(M):
  Li,Ri=(int(x) for x in input().split())
  L=Li if Li>L else L
  R=Ri if Ri<R else R
ans=R-L+1 if R>=L else 0
print(ans)
x = [int(input()) for _ in range(5)]
r = list(map(lambda a: a%10,x))
min = min(filter(lambda x: x>0, r))
ans=0
for i in range(5):
    ans+=-(-x[i]//10)*10
ans+= min-10
print(ans)

### FIXED CODE ###

x=[int(input()) for _ in range(5)]
r=list(map(lambda a: a%10,x))
min = min(list(filter(lambda x: x>0, r))+[10])
ans=0
for i in range(5):
    ans+=-(-x[i]//10)*10
ans+= min-10
print(ans)
n = int(input())

ans = 0
for i in range(1, n+1):
  for x in range(100 * x, 105 * x + 1):
    if n == x:
      ans = 1
print(ans)

### FIXED CODE ###

x = int(input())

flag = False
for c in range(1,x+1):
  if c * 100 <= x and x <= c * 105:
    flag = True
    break
print(1 if flag else 0)
N = int(input())
K = int(input())
h = list(map(int, input().split()))

num =0
for i in range(N):
    if h[i]>K or h[i] == K:
        num += 1
print(num)

### FIXED CODE ###

N,K = map(int, input().split())
h = list(map(int, input().split()))
 
num =0
for i in range(N):
    if h[i]>K or h[i] == K:
        num =num+ 1
print(num)
import math , sys

N = int( input() )
A = list( map( int, input().split() ))
A.sort()
Cs = [0 for _ in range(10**6+1)]
M = A[-1]
#print(A)
i=0
M = max(A)
for i in range(N):
    e = A[i]
    if Cs[e]==1:
        Cs[e]=2
    elif Cs[e]==0:
        Cs[e]=1

for i in range(len(Cs)):
    Cs[i] = Cs[i]%2

for e in A:
    i = 2
    while e*i <= M+1:
        Cs[e*i] = 0
        i+=1
ans = sum(Cs)
print(ans)


### FIXED CODE ###

import math , sys

N = int( input() )
A = list( map( int, input().split() ))
A.sort()
Cs = [0 for _ in range(10**6+1)]
M = A[-1]
#print(A)
i=0
M = max(A)
for i in range(N):
    e = A[i]
    if Cs[e]==1:
        Cs[e]=2
    elif Cs[e]==0:
        Cs[e]=1

for i in range(len(Cs)):
    Cs[i] = Cs[i]%2

for e in A:
    i = 2
    while e*i <= M:
        Cs[e*i] = 0
        i+=1
ans = sum(Cs)
print(ans)
N = int(input())
shiri = []
flag = 0
for i in range(N):
    tugi = str(input())
    tlist = list(tugi)
    if i!=0:
        if tugi in shiri:
            flag = 1
            break
        else:
            mae = list(shiri[i-1])
            if tlist[0]!=mae[-1]:
                flag = 1
                break
            else:
                shiri,append(tugi)
    else:
        shiri.append(tugi)
if flag == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())
shiri = []
flag = 0
for i in range(N):
    tugi = str(input())
    tlist = list(tugi)
    if i!=0:
        if tugi in shiri:
            flag = 1
            break
        else:
            mae = list(shiri[i-1])
            if tlist[0]!=mae[-1]:
                flag = 1
                break
            else:
                shiri.append(tugi)
    else:
        shiri.append(tugi)
if flag == 0:
    print("Yes")
else:
    print("No")
from operator import mul
from functools import reduce
def combination_count(n, r):
  r = min(n-r, r)
  num = reduce(modmul, range(n, n-r, -1), 1)
  denom = reduce(modmul, range(r, 1, -1), 1)
  return num*pow(denom, 10**9+5, 10**9+7)

def modmul(a, b):
  return mul(a,b)%(10**9+7)

def modinv(a, b):
  d, x, y = extgcd(a, b)
  return (d + x%b) % b

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

def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]


if (x+y)%3 != 0:
  print('0')
else:
  m = (2*x - y)//3
  n = x - 2*m
  c = combination_count(m+n, m)
  print(c%(10**9+7))

### FIXED CODE ###

x, y = map(int, input().split())

from operator import mul
from functools import reduce
def combination_count(n, r):
  r = min(n-r, r)
  num = reduce(modmul, range(n, n-r, -1), 1)
  denom = reduce(modmul, range(r, 1, -1), 1)
  return num*mod_inv(denom,10**9+7)

def modmul(a, b):
  return mul(a,b)%(10**9+7)

def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

if (x+y)%3 != 0:
  print('0')
else:
  m = (2*x - y)//3
  n = x - 2*m
  if m < 0 or n < 0:
    print('0')
  else:
    c = combination_count(m+n, m)
    print(c%(10**9+7))
s=input()
ans=0
for i in range(n):
    if s[i]=="1":
        ans+=1
print(ans)

### FIXED CODE ###

s=input()
ans=0
for i in range(6):
    if s[i]=="1":
        ans+=1
print(ans)
n,m,k = map(int,input().split())
a_list = list(map(int,input().split()))
b_list = list(map(int,input().split()))

from itertools import accumulate
sum_a_list = list(accumulate([0] + a_list))
sum_b_list = list(accumulate([0] + b_list))

ans = 0
b_idx = 0
for a_idx in range(n+1):
    if sum_a_list[a_idx] > k:
        continue

    time_rest = k - sum_a_list[a_idx]
    b_idx = bisect.bisect_left(sum_b_list,time_rest)
    
    ans = max(ans, a_idx + b_idx)
        
print(ans)

### FIXED CODE ###

n,m,k = map(int,input().split())
a_list = list(map(int,input().split()))
b_list = list(map(int,input().split()))

from itertools import accumulate
sum_a_list = list(accumulate([0] + a_list))
sum_b_list = list(accumulate([0] + b_list))

ans = 0
b_idx = m
for a_idx in range(n+1):
    if sum_a_list[a_idx] > k:
        continue
 
    while sum_a_list[a_idx] + sum_b_list[b_idx] > k:
        b_idx -= 1
    
    ans = max(ans, a_idx + b_idx)
        
print(ans)
N,A = map(int, input().split())
print(">" if N>A else "<" if N<A else "=") 

### FIXED CODE ###

N,A = map(str, input().split())
print(">" if N>A else "<" if N<A else "=")
A, B = map(int, input().split())
if A==B:
  K=1
  print(K)
else A!=B:
  if (A+B)%2==0:
    K=(A+B)/2
    print(K)
  else:
    print('IMPOSSIBLE')


### FIXED CODE ###

A, B = map(int, input().split())
if A==B:
  K=1
  print(K)
else:
  if (A+B)%2==0:
    K=(A+B)/2
    print(int(K))
  else:
    print('IMPOSSIBLE')
a,b=map(int,input().split())
if a+b>21:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

print('bwuisnt'[sum(map(int,input().split()))<22::2])
a = int(input())
b = int(input())
c = int(input())

print((a+b)*h//2)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())

print((a+b)*c//2)
N, K = map(int, input().split())
sushi = []
for i in N:
    s = list(map(int, input().split()))
    sushi.append(s)


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

def find_next(start, curr, point, tlist, tcount):
    if start == N:
        return [point, curr]
    max_c = curr
    max_p = point
    for s in sushi[start:]:
        if tlist[s[0]] > 0:
            continue
        for ri in range(len(curr) - 1, -1, -1):
            r = curr[ri]
            if tlist[r[0]] >= 2:
                c2 = [c for c in curr]
                t2 = [t for t in tlist]
                del c2[ri]
                c2.append(s)
                t2[r[0]] -= 1
                t2[s[0]] = 1
                p2 = point - r[1] + s[1] + (tcount + 1) * (tcount + 1) - tcount * tcount
                np, pc = find_next(start + 1, c2, p2, t2, tcount + 1)

                if np > max_p:
                    max_p = np
                    max_c = pc
                break
    return [max_p, max_c]

result = sushi[0: K]
type_count = [0] * (N + 1)

for r in result:
    type_count[r[0]] += 1
type_num = 0
for t in type_count:
    if t > 0:
        type_num += 1
point = type_num * type_num
for r in result:
    point += r[1]
ans_p, ans_c = find_next(K, result, point, type_count, type_num)

print(ans_p)


### FIXED CODE ###

N, K = map(int, input().split())
sushi = []
for i in range(N):
    s = list(map(int, input().split()))
    sushi.append(s)


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

# pick from first
point = 0
neta_set = set()
removable_idx = list()
for i in range(K):
    s = sushi[i]
    point += s[1]
    if s[0] not in neta_set:
        neta_set.add(s[0])
    else:
        removable_idx.append(i)
point += len(neta_set) **2
max_point = point

# pick latest
for s in sushi[K:]:
    if len(removable_idx) == 0:
        break
    if s[0] in neta_set:
        continue
    idx = removable_idx[-1]
    count = len(neta_set)
    point += s[1] - sushi[idx][1]
    point += (count + 1) ** 2 - count ** 2
    neta_set.add(s[0])
    removable_idx = removable_idx[:-1]

    if point > max_point:
        max_point = point
print(max_point)
yandy
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]

data.sort()

price = 0
for d in data:
    price += d[0] * min(M, d[1])
    M -= d[1]
    if M <= 0:
        break
print(price)


### FIXED CODE ###

N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    cost=cost-((honsu-M)*data[i][0])
    print(cost)
    exit()
print(cost)
n=int(input())
l=[]
for i in range(n):
  s,p=map(int,input().split())
  l.append([i+1,s,p])
l.sort(key=lambda x:x[2],reverse=True)
l.sort(key=lambda x:x[1])
for ll in l:
  print(ll[0])

### FIXED CODE ###

n=int(input())
lists=[]
for x in range(n):
  a,b=input().split()
  lists.append([a,int(b),x+1])
lists.sort(key=lambda t:t[1],reverse=True)
lists.sort(key=lambda t:t[0])
for x in range(n):
  print(lists[x][2])
N, M = map(int, input().split())
A = []
B = []

for i in xrange(M):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
for i in xrange(M):
    A.append(B[i])
    B.append(A[i])

result = []
stack = []

def path(start, visited):
    if len(visited) >= N:
        if visited not in result:
            result.append(visited[:])
        exit
    stack.append(start)
    if len(stack) > 0:
        nextpoint = stack.pop()
        if nextpoint not in visited:
            visited.append(nextpoint)
            for i in xrange(2*M):
                if A[i] == start:
                    path(B[i], visited)
            visited.pop()

path(1, [])
print(len(result))


### FIXED CODE ###

N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(M)]

result = []
stack = []

def path(start, visited):
    if len(visited) >= N:
        result.append(visited[:])
        exit
    stack.append(start)
    if len(stack) > 0:
        nextpoint = stack.pop()
        if nextpoint not in visited:
            visited.append(nextpoint)
            for i in range(M):
                if A[i][0] == start:
                    path(A[i][1], visited)
                if A[i][1] == start:
                    path(A[i][0], visited)
            visited.pop()

path(1, [])
result = list(map(list, set(map(tuple, result))))
print(len(result))
r=int(input())
print(r＊r)

### FIXED CODE ###

r=int(input())
print(r*r)
import math
import functools
n=int(input())
a=list(map(int,input().split()))
tmp=1
for f in a:
    tmp*=f
gcd=functools.reduce(math.gcd, a)
lcm=tmp//gcd
lcm-=1
ans=0
for f in a:
    ans+=lcm%f
print(ans)

### FIXED CODE ###

import fractions
n=int(input())
A=list(map(int,input().split()))
gd=1
tmp=A[0]
for i in range(n-1):
    gd=fractions.gcd(A[i+1],A[i])
    tmp*=A[i+1]
lcm=tmp//gd
lcm-=1
ans=0
for a in A:
    ans+=lcm%a

print(ans)
r = int(input());print("ABC"if r<1200else"ARC"if else r<2800else"AGC")

### FIXED CODE ###

r = int(input())
print("ABC" if r<1200 else "ARC" if r<2800 else "AGC")
def Check(xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2)
    # the case A's upper left point in B
    if xb1 <= xa1 <= xb2 and yb1 <= ya2 <= yb2:
        return True
    # the case A's upper rihgt point in B
    if xb1 <= xa2 <= xb2 and yb1 <= ya2 <= yb2:
        return True
    # the case A's lowerr left point in B
    if xb1 <= xa1 <= xb2 and yb1 <= ya1 <= yb2:
        return True
    # the case A's lowerr right point in B
    if xb1 <= xa2 <= xb2 and yb1 <= ya1 <= yb2:
        return True

while True:
    try:
        xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2 = map(float, raw_input().split())
        print "YES" if Check(xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2) else "NO"
    except:
        break

### FIXED CODE ###

while True:
    try:
        xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2 = map(float, raw_input().split())
        print "NO" if (xb2 < xa1 or xa2 < xb1 or yb2 < ya1 or ya2 < yb1) else "YES"
    except:
        break
s = input()
t = input()
n = len(s)
m = len(t)
i = 0
j = 0
point = []
if n<m:
    print("UNRESTORABLE")
    exit()
while i<n:
    if s[i]==t[j] or s[i]=="?":
        j+=1
        i+=1
    else:
        j=0
        i+=1

    if j==m:
        point.append(i-m)
        j = 0
        i -=m
        i+=1
if len(point)==0:
    print("UNRESTORABLE")
    exit()
i = 0
ans = 0
for l in range(len(point)):
    a = (s[:point[l]]+t+s[point[l]+m:]).replace("?","a")
    ans.append(a)
ans.sort()
print(ans)


### FIXED CODE ###

s = input()
t = input()
n = len(s)
m = len(t)
ans = []
for i in range(n-m+1):
    flag = True
    for j in range(m):
        if s[i+j]!="?" and s[i+j]!=t[j]:
            flag = False
            break
    if flag:
        tmp = (s[:i] + t + s[(i+m):])
        a = []
        for j in range(n):
            if tmp[j]=="?":
                a.append("a")
            else:
                a.append(tmp[j])
        tmp = "".join(a)
        ans.append(tmp)

ans.sort()

if len(ans)>0:
    print(ans[0])
else:
    print("UNRESTORABLE")
import collections

n = int(input());
S = [];

for i in range(n):
  S.append(input());

c = collections.Counter(S)

num = c.most_common()[0][1];
ans = [];

for i in range(len(c)):
  if c.most_common()[i][1] == num:
    ans.append(c.most_common()[i][0]);
    continue;
    
  else:
    break;
    
for a in len(ans):
  print(ans[a]);


### FIXED CODE ###

import collections

n = int(input());
S = [];

for i in range(n):
  S.append(input());

c = collections.Counter(S)

num = c.most_common()[0][1];
ans = [];

for a,b in c.most_common():
    if b == num:
      ans.append(a);
      continue;
    
    else:
      break;

ans = sorted(ans);

for i in ans:
  print(i);
s = input()
e = 0
if c<d:
  if s[a:c-1].count("##")==0 and s[b:d-1].count("##")==0:
    print("Yes")
  else:
    print("No")
else:
  if s[a:c-1].count("##")==0 and s[b:d-1].count("##")==0 and s.[b-2:d+1].count("...")>0:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

n,a,b,c,d = (int(i) for i in input().split())  
s = input()
e = 0
if c<d:
  if s[a:c-1].count("##")==0 and s[b:d-1].count("##")==0:
    print("Yes")
  else:
    print("No")
else:
  if s[a:c-1].count("##")==0 and s[b:d-1].count("##")==0:
    for i in range(b-1,d):
      if s[i-1:i+2]=="..." :
        e = 1 
    if e == 1:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
# -*- coding: utf-8 -*-
import sys
from collections import defaultdict,deque

H,W=map(int, sys.stdin.readline().split())
CH,CW=map(int, sys.stdin.readline().split())
CH-=1
CW-=1
DH,DW=map(int, sys.stdin.readline().split())
DH-=1
DW-=1
S=[ sys.stdin.readline().strip() for _ in range(W) ]

D=[(0,1),(0,-1),(1,0),(-1,0)]
WARP=[]
for dh in range(-2,3):
    for dw in range(-2,3):
        if abs(dh)+abs(dw)<=1: continue
        WARP.append((dh,dw))

visit=defaultdict(lambda: 0) #未訪問:0 訪問済み:1
d=defaultdict(lambda: float("inf")) #スタート地点から各マスまでの距離

q=deque()
q.append((CH,CW))
d[(CH,CW)]=0

while q:
    fro_h, fro_w=q.popleft()
    visit[(fro_h, fro_w)]=1
    #歩いて移動
    for dh,dw in D:
        to_h, to_w=fro_h+dh, fro_w+dw
        if 0<=to_h<H and 0<=to_w<W and S[to_h][to_w]=="." and visit[(to_h, to_w)]==0:
            visit[(to_h, to_w)]=1
            d[(to_h, to_w)]=d[(fro_h, fro_w)]
            q.appendleft((to_h, to_w))
    #ワープ
    for dh,dw in WARP:
        to_h, to_w=fro_h+dh, fro_w+dw
        if 0<=to_h<H and 0<=to_w<W and S[to_h][to_w]=="." and visit[(to_h, to_w)]==0:
            if d[(fro_h, fro_w)]+1 < d[(to_h, to_w)]:
                d[(to_h, to_w)]=d[(fro_h, fro_w)]+1
                q.append((to_h, to_w))

if d[(DH,DW)]==float("inf"):
    print -1
else:
    print d[(DH,DW)]

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from collections import defaultdict, deque

H,W=map(int, sys.stdin.readline().split())
CH,CW=map(int, sys.stdin.readline().split())
CH-=1
CW-=1
DH,DW=map(int, sys.stdin.readline().split())
DH-=1
DW-=1
S=[ sys.stdin.readline().strip() for _ in range(H) ]

D=[(0,1),(0,-1),(1,0),(-1,0)]
WARP=[]
for dh in range(-2,3):
    for dw in range(-2,3):
        if abs(dh)+abs(dw)<=1: continue
        WARP.append((dh,dw))

d=defaultdict(lambda: float("inf")) #スタート地点から各マスまでの距離

q=deque()
q.append((0,CH,CW))
d[(CH,CW)]=0

while q:
    kyori, fro_h, fro_w=q.popleft()
    if d[(fro_h, fro_w)]<kyori: continue
    #歩いて移動
    for dh,dw in D:
        to_h, to_w=fro_h+dh, fro_w+dw
        if 0<=to_h<H and 0<=to_w<W and S[to_h][to_w]==".":
            if kyori < d[(to_h, to_w)]:
                d[(to_h, to_w)]=kyori
                q.appendleft((kyori, to_h, to_w))
    #ワープ
    for dh,dw in WARP:
        to_h, to_w=fro_h+dh, fro_w+dw
        if 0<=to_h<H and 0<=to_w<W and S[to_h][to_w]==".":
            if kyori+1 < d[(to_h, to_w)]:
                d[(to_h, to_w)]=kyori+1
                q.append((kyori+1, to_h, to_w))

if d[(DH,DW)]==float("inf"):
    print -1
else:
    print d[(DH,DW)]
def Euclid(a,b):
  r = a % b
  if r == 0:
    return b
  return Euclid(b,r)

a,b = map(int,input().split())
c = Euclid(a,b) if a > b else Euclid(b,a)

def soinsu(a):
  for i in range(2,a+1):
    if a % i == 0:
      return i
    
ans = []
while 1:
  s = soinsu(c)
  c = int(c/s)
  ans.append(s)
  if c==1:
    break
print(len(set(ans)) + 1)

### FIXED CODE ###

def Euclid(a,b):
  r = a % b
  if r == 0:
    return b
  return Euclid(b,r)
import fractions

a,b = map(int,input().split())
#c = Euclid(a,b) if a > b else Euclid(b,a)
c = fractions.gcd(a,b)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
  
if c == 1:
  print(1)
else:
  print(len(factorization(c))+1)
# coding: utf-8
# Your code here!

N, M = map(int, input().split())
arr = [0 for i in range(N)]

for i in range(M):
    A, B = map(int, input().split())
    arr[A - 1] += 1
    arr[B - 1] += 1
  
for j in range(M):
    print(arr[j])


### FIXED CODE ###

# coding: utf-8
# Your code here!

N, M = map(int, input().split())
arr = [0 for i in range(N)]

for i in range(M):
    A, B = map(int, input().split())
    arr[A - 1] += 1
    arr[B - 1] += 1
  
for j in arr:
    print (j)
# -*- coding: utf-8 -*-
a = []
while True:
    n = input()
    if n == 0:
        break
    a.append(n)

for i in len(a):
    print('Case%s: %s' %(i + 1, a[i]))



### FIXED CODE ###

# -*- coding: utf-8 -*-
c = 1
while True:
    n = int(input())
    if n == 0:
        break
    print('Case {0}: {1}'.format(c, n))
    c += 1
from math import sqrt
N = int(input())
mod = 10 ** 9 + 7 
divs = [0] * (N + 1)
for i in range(1, N + 1):
  for j in range(1, sqrt(i)):
    if i % j == 0:
      divs[j] += 1
print(sum(divs))

### FIXED CODE ###

N = int(input())
mod = 10 ** 9 + 7 
f = 1
res = 1
for i in range(2, N + 1): f *= i
for i in range(2, N + 1):
  c = 0
  while f % i == 0:
    c += 1
    f //= i
  res *= (c + 1) % mod
  res %= mod
print(res % mod)
n,m=map(int,input().split())
def yak1(n,m):
  l=[]
  for i in range(1,min(int((m)**1/2+1)),m//n+1):
    if m%i==0:
      l.append(i)
      if m//(m//i)!=m/i and m//(m//i)<=m//n:
        l.append(m//i)
  return l
print(min(yak1(n,m)))      

### FIXED CODE ###

def make_divisors(n,m):
    divisors = []
    for i in range(1,min(int(m**(1/2))+1,int(m//n)+1)):
      if m % i == 0:
          divisors.append(i)
          if i != m // i and m//i<=m//n:
              divisors.append(m//i)
    return divisors
n,m=map(int,input().split())
print(max(make_divisors(n,m)))
# -*- coding: utf-8 -*-
H,W,K=map(int, raw_input().split())
S=[ list(raw_input()) for _ in range(H)]

L=[ [] for _ in range(H) ]
ng=[]

cnt=0
ichigo=False
for h in range(H):
    cnt+=1
    ichigo=False
    for w in range(W):
        if S[h][w]=="#":
            if ichigo:
                cnt+=1
            else:
                ichigo=True
        L[h].append(cnt)
    else:
        if ichigo is False:
            ng.append(h) #イチゴが１つも入ってない行番号

def func(n,str):   #行番号 方向 u:up d:down
    #print "func(",n,",",str,")"
    if n in ng:
        if 0<=n-1: func(n-1,"u")
        if n+1<=H-1: func(n+1,"d")
    else:      #NG行でない場合
        if str=="u":
            L[n+1]=L[n]
        elif str=="d":
            L[n-1]=L[n]

for x in ng:
    func(x,"u")
    func(x,"d")

for h in range(H):
    for x in L[h]:
        print x,
    print


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
from collections import deque,defaultdict
sys.setrecursionlimit(10**5)

H,W,K=map(int, sys.stdin.readline().split())
ichigo=[]
cnt=0
h_visit=[0 for h in range(H)]  #縦軸にイチゴがない箇所は0、ある箇所は1

L=[ [] for h in range(H) ]
for h in range(H):
    s=sys.stdin.readline().strip()
    for w,x in enumerate(s):
        if x==".":
            L[h].append(0)
        elif x=="#":
            cnt+=1
            L[h].append(cnt)
            ichigo.append((h,w))
            h_visit[h]=1


D=(1,-1)

def yoko_dfs(h,w):  #縦座標、横座標
    for dw in D:
        if 0<=w+dw<=W-1 and L[h][w+dw]==0:
            L[h][w+dw]=L[h][w]
            yoko_dfs(h,w+dw)
    return

for h,w in ichigo:
    yoko_dfs(h,w)


def tate_dfs(h):  #縦座標
    for dh in D:
        if 0<=h+dh<=H-1:
            if h_visit[h+dh]==1: continue
            h_visit[h+dh]=1 #訪問済みにする
            L[h+dh]=L[h]
            tate_dfs(h+dh)

for h,w in ichigo:
    tate_dfs(h)

for l in L:
    for x in l:
        print x,
    print
n=int(input())
s=input()
count=0
for i in range(n):
    if s[i]=="A":
        if s[i+1]=="B":
            if s[i+2]=="C":
                count=count+1
                i=i+3
            else:
                i=i+2
        else:
            i=i+1
print(count)

### FIXED CODE ###

n=int(input())
s=input()
count=0
for i in range(n-2):
    if s[i]=="A":
        if s[i+1]=="B":
            if s[i+2]=="C":
                count=count+1
                i=i+3
            else:
                i=i+2
        else:
            i=i+1
print(count)
N = int(input())
counter = 0
for i in range(N):
	l,n = map(int,input().split())
 	counter += (n - l + 1)
print(counter)

### FIXED CODE ###

N = int(input())
counter = 0
for i in range(N):
 l,n = map(int,input().split())
 counter += (n-l+1)
print(counter)
n,k = map(int, raw_input().split())
s = raw_input()
cd = 0
d = None
for i,l in enumerate(s):
	if d != l:
		cd +=1
		d = l
	if i and s[i-1] == s[i]: score += 1
	

if cd > 2:
	t = min(k,((cd - 2)+1)/2)
	k -= t
	score += 2 * t 
	cd -= 2 * t
if cd == 2 and k:
	score +=1
	cd -= 1
print score

### FIXED CODE ###

n,k = map(int, raw_input().split())
s = raw_input()
cd = 0
d = None
for l in s:
	if d != l:
		cd +=1
		d = l
score = 0
for u,v in zip(s,s[1:]):
	if u == v:
		score +=1

while(k and cd > 1):

	if cd > 2:
		score += 2 
		cd -= 2
	elif cd == 2:
		score +=1
		cd -= 1
	k -=1
print score