Harryxun/stf_run huggingface dataset:
a=input()
max=[]
for i in range(3):
  if a[i]== 'R':
    if i ==0:
      max[0]=1
    else:
      max[i]=max[i-1]+1
  else:
    max[i]=0
print(sum(max))
  

### FIXED CODE ###

a=input()
f=[0]*3
for i in range(3):
  if a[i]== 'R':
    if i ==0:
      f[0]=1
    else:
      f[i]=f[i-1]+1
  else:
    f[i]=0
print(max(f))
A = int(input())
B = int(input())

0<=A<=100
0<=B<=100
 
if A>B*2:
  print(A-B*2)
 
else:
  print(0)

### FIXED CODE ###

A, B = [int(i) for i in input().split()]
0<=A<=100
0<=B<=100

if A>B*2:
  print(A-B*2)

else:
  print(0)
N = int(input())

INF = 10 ※※ 8

L = []

for i in range(1,N):
  diff = N - i
  pair = set(i,diff)
  if len(pair) == 2 and pair not in L:
    L.append(pair)

print(len(L))

### FIXED CODE ###

N = int(input())

sup = int(N // 2) + 1

L = []

for i in range(1,sup):
  diff = N - i
  pair = [i,diff]
  pair = set(pair)
  if len(pair) == 2:
    L.append(pair)


    
print(len(L))
def S(i,x,y):
	for w in [x,y]
		if 2*w >= A: return 2*w-A
	return min(S(i+1,x+a[i],y),S(i+1,x,y+a[i]))
while 1:
	n = input()
	if n == 0: break
	a = sorted(map(int,raw_input().split()))[::-1]
	A = sum(a)
	print S(1,a[0],0)

### FIXED CODE ###

def S(i,x,y):
	if 2*x >= A: return 2*x-A
	if 2*y >= A: return 2*y-A
	return min(S(i+1,x+a[i],y),S(i+1,x,y+a[i]))
while 1:
	n = input()
	if n == 0: break
	a = sorted(map(int,raw_input().split()))[::-1]
	A = sum(a)
	print S(1,a[0],0)
a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif:
  abs(a-b)<=d and abs(b-d)<=d:
    print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if abs(a-c)<=d:
  print('Yes')
elif abs(a-b)<=d and abs(b-c)<=d:
    print('Yes')
else:
  print('No')
import numpy as np

N = int(input())

temp = np.linspace(1, N, N)
re_temp = np.linspace(2, N, N-1)
re_temp = np.append(re_temp, 1)

answer = (temp % re_temp).sum()
print(int(answer))


### FIXED CODE ###

N = int(input())

answer = N * (N - 1) // 2

print(int(answer))
H=int(input())
W=int(input())
N=int(input())

if W>H :
    k=int(N/W)+1
else
    k=int(H/W)+1


print(k)

### FIXED CODE ###

import math

H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
else:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)

k=int(k)
print(k)
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import floor
from decimal import Decimal
def main():
    x = Decimal(input())

    r = 0
    m = Decimal(100)
    while m < x:
        r += 1
        m = Decimal(m * 1.01)
    print(r)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
def main():
    x = int(input())
    c = 0
    m = 100
    while True:
        m = (m * 1.01)//1
        c += 1
        if m >= x:
            print(c)
            sys.exit()
if __name__ == '__main__':
    main()
n=int(input())
a=int(input())

n//500=m

if m<=a
    print("Yes")
else :
    print("No")

### FIXED CODE ###

n=int(input())
a=int(input())

if n<500:
    if n<=a:
        print("Yes")
    else:
        print("No")
elif n>500 and (n%500)<=a:
    print("Yes")
else :
    print("No")
a,b,c,d=map(int,input().split())
A=max(a,b)
B=max(c,d)

if (A>0 and B>0):
  print(A*B)
elif A<0 and B>0:
  print(A*min(c,d))
elif A>0 and B<0:
  print(min(a,b)*B)
elif A<=0 and B<=0:
  print(min(a,b)*min(c,d))


### FIXED CODE ###

x = int(input())

if x == 0:
  print(1)
elif x == 1:
  print(0)
a,b,c=map(int,input.rstrip().split(' '))
if (a<c<b) or (b<c<a):
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c=map(int,input().rstrip().split(' '))
if (a<c<b) or (b<c<a):
  print('Yes')
else:
  print('No')
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
sc = list(map(list, set(map(tuple, sc))))

l = list()
for i in range(1000):
    i = str(i)
    flg = True
    for j in sc:
        if i[j[0]-1] != j[1]:
            flg = False
    if flg:
        l.append(i)

print(min(l))

### FIXED CODE ###

n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
sc = list(map(list, set(map(tuple, sc))))

ans = [-1] * n
for i in sc:
    if i[0] == 1 and i[1] == 0 and n == 1:
        print(0)
        exit()
    if i[0] == 1 and i[1] == 0:
        print(-1)
        exit()
    if i[0] > n or ans[i[0]-1] != -1:
        print(-1)
        exit()
    ans[i[0]-1] = i[1]

for i, val in enumerate(ans):
    if val == -1:
        ans[i] = 0

if (m == 0 and n != 1) or (ans[0] == 0 and n != 1):
    ans[0] = 1

flg = False
for i in ans:
    if i != 0:
        flg = True
if not flg:
    print(0)
    exit()

ans = map(lambda x: str(x), ans)
print("".join(ans))
N, K = map(int, input().split())
dist = [[] for i in range(N)]
A = list(map(int, input().split()))
for i in range(N):
    dist[i].append(A[i] - 1)
dp = [[0, 0] for i in range(N)]

def dfs(pos, depth):
    # 初めての訪問なら
    if dp[pos][0] == 0:
        dp[pos][0] = depth
        for i in dist[pos]:
            dfs(i, depth + 1)
    elif dp[pos][1] == 0:
        dp[pos][1] = depth
        for i in dist[pos]:
            dfs(i, depth + 1)
dfs(0, 0)
for i in range(N):
    split = dp[i][1] - dp[i][0]
    if split != 0:
        if (K - dp[i][0]) % split == 0:
            print(i + 1)
            exit()

### FIXED CODE ###

def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))

from collections import defaultdict, deque
from sys import exit
import math
import copy
from bisect import bisect_left

import sys
# sys.setrecursionlimit(1000000)
# list(map(int, input().split()))
n, k = getList()
# dist
nums = [0] + getList()
cnt = 1
if k == 1:
    print(1)
    exit()
cur = 1
visited = [-1 for i in range(n + 1)]
visited[1] = 1
rooped = False
while True:
    # cur 行き先
    cur = nums[cur]
    cnt += 1

    # １回目に訪れていたら
    if visited[cur] != -1:
        # ループの周期
        roop = cnt - visited[cur]
        # 途中を飛ばす
        k -= ((k-cnt) // roop) * roop
        rooped = True
    if not rooped:
        # １回目に訪れたのであれば
        visited[cur] = cnt

    if cnt == k:
        print(nums[cur])
        break
s = input()
a = ['Sunny','Cloudy','Rainy']
print(a[(a.index(s)+1) % 3]


### FIXED CODE ###

s = input()
if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
S = input()
s = S[4:6] + S[7:9]
s = int(s)

if s < 501:
  print('Heisei')
else:
  print('TBD')

### FIXED CODE ###

S = input()
s = S[5:7] + S[8:10]
s = int(s)

if s < 501:
  print('Heisei')
else:
  print('TBD')
import sys
from collections import deque
sys.setrecursionlimit(10 ** 5)
input = sys.stdin.readline


def main():
    N, Q = map(int, input().split())
    ans = deque([0] * N)
    con = deque([[] for _ in range(N)])

    for _ in range(N - 1):
        p, c = map(int, input().split())
        con[p-1].append(c-1)
        con[c-1].append(p-1)

    for _ in range(Q):
        p, v = map(int, input().split())
        ans[p-1] += v

    stacks = deque()
    stacks.append((0, -1))

    while stacks:
        stack = stacks.pop()
        node, parent = stack[0], stack[1]

        children = con[node]
        if children:
            for child in children:
                if child == parent:
                    continue
                ans[child] += ans[node]
                stacks.append((child, node))

    print(*ans, sep=' ')


if __name__ == '__main__':
    main()


### FIXED CODE ###

n = int(input())
s = input()

if n >= 3200:
  print(s)
else:
  print('red')
import unittest

from app.ABC103_A import run


class TestSample(unittest.TestCase):
    def test_run(self):
        self.assertEqual(run([1, 6, 3]), 5)
        self.assertEqual(run([11, 5, 5]), 6)
        self.assertEqual(run([100, 100, 100]), 0)


if __name__ == '__main__':
    unittest.main()


### FIXED CODE ###

def run(a):
    return max(a) - min(a)


def read_line():
    a = list(map(int, input().split()))
    return a


def main():
    a = read_line()
    print(run(a))


if __name__ == '__main__':
    main()
n,m = map(int,input().split())
A = list(map(int,input().split()))
L = [2,5,5,4,5,6,3,7,6]
dp = [-float('inf')]*(n+1)
dp[0] = 0
for i in range(1,n+1):
    for j in range(m):
        if i-L[A[j]-1] < 0:
            None
        else:
            dp[i] = max(dp[i-L[A[j]-1]]+1, dp[i])
A.sort()
A.reverse()
cur = n
ans = ''
while cur != 0:
    for i in range(m):
        temp = A[i]
        if dp[cur-L[temp-1]] == dp[cur]-1:
            ans = ans+str(temp)
            cur -= L[temp-1]
            break
print(ans)


### FIXED CODE ###

n,m = map(int,input().split())
A = list(map(int,input().split()))
L = [2,5,5,4,5,6,3,7,6]
dp = [-float('inf')]*(n+1)
dp[0] = 0
for i in range(1,n+1):
    for j in range(m):
        if i-L[A[j]-1] < 0:
            None
        else:
            dp[i] = max(dp[i-L[A[j]-1]]+1, dp[i])
A.sort()
A.reverse()
cur = n
ans = ''
while cur != 0:
    for i in range(m):
        temp = A[i]
        if cur-L[temp-1] >= 0:
            if dp[cur-L[temp-1]] == dp[cur]-1:
                ans = ans+str(temp)
                cur -= L[temp-1]
                break
print(ans)
from collections import Counter
N, M = map(int, input().split())
groups = [0] * (N + 1)
group_num_list = [[0]]
group_num = 1
for _ in range(M):
    A, B = map(int, input().split())
    if groups[A] != 0 and groups[B] != 0:
        if groups[A] != groups[B]:
            lower = min(groups[A], groups[B])
            higher = max(groups[A], groups[B])
            for i in group_num_list[higher]:
                groups[i] = lower
            tmp = group_num_list[higher]
            group_num_list[lower].extend(tmp)
            del group_num_list[higher]
    elif groups[A] != 0:
        groups[B] = groups[A]
        group_num_list[groups[A]].append(B)
    elif groups[B] != 0:
        groups[A] = groups[B]
        group_num_list[groups[B]].append(A)
    else:
        groups[A] = group_num
        groups[B] = group_num
        group_num_list.append([A, B])
        group_num += 1
counter = Counter(groups)
# print(collection)
# print(group_num_list)
if counter.most_common()[0][0] != 0:
    print(counter.most_common()[0][1])
else:
    print(counter.most_common()[1][1])


### FIXED CODE ###

from collections import Counter
N, M = map(int, input().split())
groups = [0] * (N + 1)
group_num_list = [[0]]
group_num = 1
for _ in range(M):
    A, B = map(int, input().split())
    if groups[A] != 0 and groups[B] != 0:
        if groups[A] != groups[B]:
            lower = min(groups[A], groups[B])
            higher = max(groups[A], groups[B])
            for i in group_num_list[higher]:
                groups[i] = lower
            tmp = group_num_list[higher]
            group_num_list[lower].extend(tmp)
            # del group_num_list[higher]
    elif groups[A] != 0:
        groups[B] = groups[A]
        group_num_list[groups[A]].append(int(B))
    elif groups[B] != 0:
        groups[A] = groups[B]
        group_num_list[groups[B]].append(int(A))
    else:
        groups[A] = group_num
        groups[B] = group_num
        group_num_list.append([int(A), int(B)])
        group_num += 1
counter = Counter(groups)
# print(collection)
# print(group_num_list)
if len(group_num_list) == 1:
    print(1)
elif int(counter.most_common()[0][0]) != 0:
    print(counter.most_common()[0][1])
else:
    print(counter.most_common()[1][1])
def uq(a,c):
    return c if a%c==0 else uq(c,a%c)

n=(int)(input())

result = 1

for j in range(0,n):
    f=(int)(input())
    result=((result/uq(result,f)))*f
    
print((int)(result))

### FIXED CODE ###

def uq(a,c):
    return c if a%c==0 else uq(c,a%c)

n=(int)(input())

result = 1

for j in range(0,n):
    f=(int)(input())
    result=((result//uq(result,f)))*f
    
print((int)(result))
D = input()

if D == "25":
	print("Christmas")
elif D === "24":
	print("Christmas Eve")
elif D == "23":
	print("Christmas Eve Eve")
elif D == "22":
	print("Christmas Eve Eve Eve")

### FIXED CODE ###

D = int(input())
 
if D == 25:
	print("Christmas")
elif D == 24:
	print("Christmas Eve")
elif D == 23:
	print("Christmas Eve Eve")
elif D == 22:
	print("Christmas Eve Eve Eve")
import math
tan, tyou, hour, minute = input()
tan_rad = 30 * hour
tyou_rad = 6 * minute
if tan_rad == tyon_rad:
  answer = abs(tyou - tan)
else:
  rad = abs(tan_rad - tyou_rad)
if rad:
  answer = math.sqrt((tan ** 2) + (tyou ** 2) - 2 * tan * tyou * math.cos(math.radius(rad)))
print(answer)

### FIXED CODE ###

import math
ji, hun, H, M = input().split()
ji = int(ji)
hun = int(hun)
H = int(H)
M = int(M)
ji_rad = 30 * H + 0.5 * M
hun_rad = 6 * M
diff = abs(ji_rad - hun_rad)
if diff == 0:
  answer = abs(ji - hun)
elif diff == 180:
  answer = ji + hun
else:
  if diff > 180:
      diff = abs(360 - diff)
  answer = math.sqrt((ji ** 2) + (hun ** 2) - 2 * ji * hun * math.cos(math.radians(diff)))
print(answer)
s,t,u = input().spilt()

print(s[0].upper()+t[0].upper()+u[0].upper())



### FIXED CODE ###

s,t,u = input().split()

print(s[0].upper()+t[0].upper()+u[0].upper())
a,b,c=map(int,input().split())

if a+b+1=>c:
    ans=b+c
else:
    ans=a+b+1+b
    
print(ans)

### FIXED CODE ###

a,b,c=map(int,input().split())

if a+b+1>=c:
    ans=b+c
else:
    ans=a+b+1+b
    
print(ans)
N,M=map(int,input().split())
ab=[tuple(map(int,input().split())) for i in range(M)]

ab.sort()
l=1,r=N
ans=1
for a,b in ab:
  l=max(a,l)
  r=min(b,r)
  if l>=r:
    ans+=1
    l=a
    r=b
print(ans)
  

### FIXED CODE ###

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


ab = [tuple(map(int, input().split())) for i in range(M)]
ab = [tuple([ab[i][0], ab[i][1], i]) for i in range(M)]

ans = 1
tmp = 0

a = sorted(ab, key=lambda x: x[0])
b = sorted(ab, key=lambda x: x[1])

checked = set()

for i in range(M):
    if b[tmp][1] <= a[i][0]:
        ans += 1
        while(b[tmp][1] <= a[i][0] or b[tmp][2] in checked):
            tmp += 1
    checked.add(a[i][2])


print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

n, k = map(int, input().split())
a = [int(x) for x in input().split()]

left = -1
right = 10**9 + 1

while right - left > 1:
    mid = (right + left) // 2
    cnt = 0
    for b in a:
        cnt += b // mid + int(b % mid != 0) - 1
    if cnt <= k:
        right = mid
    else:
        left = mid
print(right)

### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

n, k = map(int, input().split())
a = [int(x) for x in input().split()]

left = 0
right = 10**9 + 1

while right - left > 1:
    mid = (right + left) // 2
    cnt = 0
    for b in a:
        cnt += b // mid + int(b % mid != 0) - 1
    if cnt <= k:
        right = mid
    else:
        left = mid
print(right)
from numpy.linalg import solve

#制約
MOD = 10**9 +7
MAX = 10**6

#　組み合わせ計算
def COM(n, r):
    fac = [1, 1]
    finv = [1, 1]
    inv = [0, 1]
    for i in range(2, MAX):
        fac.append(fac[i - 1] * i % MOD)
        inv.append(-inv[MOD % i] * (MOD // i))
        finv.append(finv[i - 1] * inv[i] % MOD)
    if n < r:
        return 0
    if n < 0 or r < 0:
        return 0
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD

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

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

l = solve([[2, 1], [1, 2]], [x, y])
if l[0] < 0 or l[1] < 0: #n,m <0の時0
    print(0)
    exit()
# n+m回のうち，どのn回で移動するか n+mCOMnを計算
print(COM(int(l[0]+l[1]), int(l[0])))


### FIXED CODE ###

from numpy.linalg import solve

#制約
MOD = 10**9 +7
MAX = 10**6

#　組み合わせ計算
def COM(n, r):
    fac = [1, 1]
    finv = [1, 1]
    inv = [0, 1]
    for i in range(2, MAX):
        fac.append(fac[i - 1] * i % MOD)
        inv.append(-inv[MOD % i] * (MOD // i))
        finv.append(finv[i - 1] * inv[i] % MOD)
    if n < r:
        return 0
    if n < 0 or r < 0:
        return 0
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD

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

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

l = solve([[2, 1], [1, 2]], [x, y])
if l[0] < 0 or l[1] < 0: #n,m <0の時0
    print(0)
    exit()
# n+m回のうち，どのn回で移動するか n+mCOMnを計算
print(COM(int(l[0]+l[1]), int(l[0])))
def main():
	data = list(map(int,input().split()))
	a = data[0]
	b = data[1]
	c = data[2]
	d = data[3]
	print(min(a,b)+min(c,d))

if __name__ == '__main__':
	main()

### FIXED CODE ###

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

print(min(a,b)+min(c,d))
N,M = map(int, input().split())
t_table = {}
for i in range(M):
	x,y = map(int, input().split())
	if x-1 in t_table: t_table[x-1].append(y-1)
	else: t_table[x-1] = [y-1]
ans = 0
dp = [1 for _ in range(N)]
zerolist = [0 for _ in range(N)]
while True:
	pnode = dp.copy()
	dp = [0 for _ in range(N)]
	for i in range(N):
		if pnode[i] == 1 and i in t_table:
			for j in t_table[i]:
				if dp[j]==0 : dp[j]= 1
	if(dp == zerolist):
	 	print(ans)
	 	break
	ans += 1

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**5+10)
input = sys.stdin.readline

N,M = map(int, input().split())
lst_edge = [[] for _ in range(N)]
for _ in range(M):
	x,y = map(int, input().split())
	lst_edge[x-1].append(y-1)

dp = [-1] * N

def rec(v):
	if dp[v] != -1:
		return dp[v]
	ans = 0
	lst_nv = lst_edge[v]
	for nv in lst_nv:
		ans = max(ans, rec(nv)+1)
	dp[v] = ans
	return dp[v]

ans = 0
for v in range(N):
	ans = max(ans,rec(v))
print(ans)
import random
import time
import copy
import math
start=time.time()
d=int(input())
c=list(map(int,input().split()))
s=[]
cli=[]
for i in range(d+1):
  ch=[]
  for j in c:
    ch.append(i*j)
  cli.append(ch)
for i in range(d):
  s.append(list(map(int,input().split())))
last=[0]*26
score=0
solution=[]
for day in range(1,d+1):
  co=[]
  dla=[]
  down=0
  for (i,j) in zip(last,c):
    down+=(day-i)*j
  for (i,j) in zip(last,c):
    dla.append(down-(j*(day-i)))
  for con in range(26):
    co.append(s[day-1][con]-dla[con])
  choice=co.index(max(co))
  score+=co[choice]
  last[choice]=day
  #print(choice+1)
  #print(score)
  solution.append(choice)
#print(score)
stemp=4000
etemp=100
def tem()
  return stemp-((stemp-etemp)*(time.time()-start)/1.9)
while time.time()-start<1.9:
  
  sc=0
  sol=copy.deepcopy(solution)
  for x in [random.randrange(d) for i in range(1)]:
    sol[x]=random.randrange(26)
  last=[0]*26
  for (day,i) in zip(range(1,d+1),sol):
    sc+=s[day-1][i]
    last[i]=day
    for (i,j) in zip(last,range(26)):
      sc-=cli[day-i][j]
  try:
    prob = math.exp((sc-score)/tem())
  except:
    prob=0
  #print("{} {}".format(sc,prob))
  if prob>random.random():
    solution=copy.deepcopy(sol)
    score=sc
    #print(score)
for i in solution:
  print(i+1)
#print(sco)


### FIXED CODE ###

d=int(input())
c=list(map(int, input().split()))
s=[]
for i in range(d):
  s.append(list(map(int, input().split())))
for i in s:
  print(i.index(max(i))+1)
A, B= map(int(input().split))
OP= input()
P= A + B
M= A - B
print(P if OP== + else M)

### FIXED CODE ###

print(eval(input()))
N, A, B = map(int, input().split())
mo = 10 ** 9 + 7
def hanaya(n, x):
    if x == 1:
        return n
    else:
        return (((hanaya(n, x-1))*((n-x+1)/x))%mo)

ans = (pow(2, N, mo) - 1 - hanaya(N, A)- hanaya(N, B)) % mo
print(int(ans))

### FIXED CODE ###

N, A, B = map(int, input().split())
mo = 1000000007
A_val = 1
for i in range(A):
    A_val = ((A_val * (N - i) * pow(i+1, mo-2, mo))) % mo
B_val = 1
for i in range(B):
    B_val = ((B_val * (N - i) * pow(i+1, mo-2, mo))) % mo
    
ans = (pow(2, N, mo) - 1 - A_val - B_val) % mo
print(ans)
X = int(input())
flag = 1
if X < 100:
  flag = 0
else:
  a = X%100
  b = a%10
  c = (a-b)/10
  count = 2*c
  if 1 <= b <= 5:
    conut += 1
  elif 6<= b <= 9:
    count += 2
  if X//100 < count:
    flag = 0
print(flag)
      

### FIXED CODE ###

X = int(input())
flag = 1
if X < 100:
  flag = 0
else:
  a = X%100
  b = a%10
  c = (a-b)/10
  count = 2*c
  if 1 <= b <= 5:
    count += 1
  elif 6<= b <= 9:
    count += 2
  if X//100 < count:
    flag = 0
print(flag)
def main37():
    num = int(input())
    data = input().split()
    retu = []
    for i in range(num):
        retu.append(int(data[i]))
    kari = list(retu)
    kari.sort()
    kosu = 0
    for i in range(num):
        if retu[i] != kosu[i]:
            kosu = kosu + 1
    if kosu == 2 or kosu == 0:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main37()

### FIXED CODE ###

def main37():
    num = int(input())
    data = input().split()
    retu = []
    for i in range(num):
        retu.append(int(data[i]))
    kari = list(retu)
    kari.sort()
    kosu = 0
    for i in range(num):
        if retu[i] != kari[i]:
            kosu = kosu + 1
    if kosu == 2 or kosu == 0:
        print("YES")
    else:
        print("NO")

if __name__ == "__main__":
    main37()
n = input()
s = [0] * 2020
m = [0] * 2020
m[0] = 1
s[0] = 1
for i in range(1, 2020):
    m[i] = (m[i-1]*10) % 2019
tmp = 0
for i in range(len(n)):
    #print(i, n[-1-i], m[i])
    tmp = (tmp + int(n[-1-i])*m[i]) % 2019
    # print(tmp)
    s[tmp] += 1
su = 0
for i in s:
    if i > 1:
        # print("#", i)
        su += i * (i - 1)//2
print(su)


### FIXED CODE ###

n = input()
l = len(n)
s = [0] * 2020
m = [0] * (l+1)
m[0] = 1
s[0] = 1
for i in range(1, l+1):
    m[i] = (m[i-1]*10) % 2019
tmp = 0
n = list(n)[::-1]
for i in range(len(n)):
    #print(i, n[-1-i], m[i])
    tmp = (tmp + int(n[i])*m[i]) % 2019
    # print(tmp)
    s[tmp] += 1
su = 0
for i in s:
    if i > 1:
        # print("#", i)
        su += i * (i - 1)//2
print(su)
import sys

a, b = [float(i) for i in sys.stdin.readline().split()]
a = int(a)
a *= int(b * 100)
print(int(str(a)[:-2]))

### FIXED CODE ###

from decimal import *
A,B = input().split()
A = int(A)
B = Decimal(B)
print(int(A*B))
a,b,n=map(int,input().split())
C = [a:min(a+n,b)]|[max(a,b-n):b]
for i in C:
  print(i)

### FIXED CODE ###

a,b,k=map(int,input().split())
if b-a+1>k*2:
  for i in range(a,a+k):
    print(i)
  for j in range(b-k+1,b+1):
    print(j)
else:
  for h in range(a,b+1):
    print(h)
import re

N, Q = map(int, input().split())
S = list(input())
P = []

for _ in range(Q):
	l, r = map(int, input().split())
	P.append((l, r))

for p in P:
	s = S[p[0] - 1:p[1]]
	I = [i for i, x in enumerate(s) if x == "A"]
	if I[-1] == (len(s) - 1):
		I.pop()
	count = 0
	for i in I:
		if s[i + 1] == "C":
			count += 1
	print(count)


### FIXED CODE ###

N, Q = map(int, input().split())
S = input()

# S         * A C * A C C
# sumlist   0 0 1 1 1 2 2
sumlist = [0]
for i in range(1, len(S)):
	sumlist.append(sumlist[-1])
	if S[i - 1] == "A" and S[i] == "C":
		sumlist[-1] += 1

query = []
for i in range(Q):
	l, r = map(int, input().split())
	query.append(dict(l=l-1, r=r-1))

for q in query:
	print(sumlist[q["r"]] - sumlist[q["l"]])
import math
sin60 = math.sin(60*math.pi/180)
def koch(n,p1,p2):
    if n==0:
        return
    s = [ ( 2*p1[0] + 1*p2[0] ) / 3 , ( 2*p1[1] + 1*p2[1]) / 3 ]
    t = [ ( 1*p1[0] + 2*p2[0] ) / 3 , ( 1*p1[1] + 2*p2[1]) / 3 ]
    u = [ ( t[0] - s[0] ) *0.5 - ( t[1] - s[1] )*sin60 + s[0],
        ( t[0] - s[0] )*sin60 + ( t[1] - s[1] )*0.5 + s[1] ]
    koch(n-1,p1,s)
    print s[0],s[1]
    koch(n-1,s,u)
    print u[0],u[1]
    koch(n-1,u,t)
    print t[0],t[1]
    koch(n-1,t,p2)
        
n  = raw_input()
p1 = (0,0)
p2 = (100,0)
print p1[0],p1[1]
koch(n,p1,p2)
print p2[0],p1[1]

### FIXED CODE ###

import math
sin60 = math.sin(60*math.pi/180)
def koch(n,p1,p2):
    if n==0:
        return
    s = [(2*p1[0]+1*p2[0])/3., (2*p1[1]+1*p2[1])/3.]
    t = [(1*p1[0]+2*p2[0])/3., (1*p1[1]+2*p2[1])/3.]
    u = [(t[0]-s[0])*0.5 - (t[1]-s[1])*sin60+ s[0],
        (t[0]-s[0])*sin60 + (t[1]-s[1])*0.5 + s[1]]
    koch(n-1,p1,s)
    print s[0],s[1]
    koch(n-1,s,u)
    print u[0],u[1]
    koch(n-1,u,t)
    print t[0],t[1]
    koch(n-1,t,p2)
        
n = int(raw_input())
p1 = (0,0)
p2 = (100,0)
print p1[0],p1[1]
koch(n,p1,p2)
print p2[0],p1[1]
n = int(input())
s = input()
l = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') * 2
a = ''

for i in s:
    a += l[l.index(i) + n]

pritn(a)

### FIXED CODE ###

n = int(input())
s = input()
l = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ') * 2
a = ''

for i in s:
    a += l[l.index(i) + n]

print(a)