Harryxun/stf_run huggingface dataset:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(1,n):
  if a[i-1]>a[i]
    ans+=a[i-1]-a[i]
    a[i]=a[i-1]
print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(1,n):
  if a[i-1]>a[i]:
    ans+=a[i-1]-a[i]
    a[i]=a[i-1]
print(ans)
n = int(input())
l = list(map(int, input().split()))
l2 = l.copy()

l.sort(reverse=True)
l2.sort()
for num in range(n):
	if(l[0] > sum(l2[1:n])):
  		print("Yes")
		break
print("No")


### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
 
l.sort(reverse=True)
if(l[0] < sum(l[1:n])):
  print("Yes")
else:
  print("No")
from functools import reduce
from math import gcd

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

c=max(A)+1
D=[0]*c
div=[0]*c
P=[]

for i in range(2,c):
    if D[i]==0:
        P.append(i)
        D[i]=i
    for j in P:
        if i*j>=c  or j>D[i] :
           break
        D[i*j]=j

for i in A:
    if i==1:
        continue
    temp=i
    pt=[]
    while temp!=1:
        if D[temp] not in pt:
            div[D[temp]]+=1
        pt.append(D[temp])
        temp=temp//D[temp]

#print(div)

if max(div)==1:
    print('pairwise coprime')
    hoge

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')

### FIXED CODE ###

from functools import reduce
from math import gcd

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

c=max(A)+1
D=[0]*c
div=[0]*c
P=[]

for i in range(2,c):
    if D[i]==0:
        P.append(i)
        D[i]=i
    for j in P:
        if i*j>=c  or j>D[i] :
           break
        D[i*j]=j
f=0
for i in A:
    if i==1:
        continue
    temp=i
    while temp!=1:
        if div[D[temp]]==1:
            f=1
            break
        div[D[temp]]+=1
        temp2=D[temp]
        while temp%temp2==0 and temp>=temp2:
            temp=temp//temp2
    if f==1:
        break
        


if max(div)<=1 and f==0:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')
a=input()
if a~="ARC":
  print("ABC")
 
if a~="ABC":
  print("ARC")

### FIXED CODE ###

a=input()
if a=="ARC":
  print("ABC")
 
if a=="ABC":
  print("ARC")
n, q = map(int,input().split())
cnt = [0] * (n+1)
import numpy as np
tree = np.zeros((n+1, n+1))
part = [0] * (n+1)
for i in range(n-1):
    a, b = map(int,input().split())
    tree[a][b] = 1
def dfs(i):
    ret = [i]
    global part
    if tree[i] == [0] * n:
        part[i] = ret
        return ret
    for j in range(n+1):
        if tree[i][j] == 1:
            ret.extend(dfs(j))
    part[i] = ret
    return ret
dfs(1)
for _ in range(q):
    p,x = map(int,input().split())
    for node in part[p]:
        cnt[node] += x
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:])
x = int(input())
y = list(map(int, input().split()))

count = 0

for i in y:
    if i % 2 = 0:
        y[i] == i % 2
        count += 1
    else:
        pass
        


### FIXED CODE ###

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

z = True
count = -1
while z == True:
    count += 1
    for i, j in enumerate(y):
        if j % 2 == 0:
            y[i] = j / 2
        else:
            z = False

print(count)
n, y = map(int, input().split())

# n, y = 1000, 1234000

flg = False
for i in range(y//10000 + 1):
    diff_1 = y - i*10000
    for j in range(diff//5000 + 1):
        diff_2 = diff_1 - j*5000
        for k in range(diff//1000 + 1):
            diff_3 = diff_2 - k*1000
            if diff_3 == 0 and i+j+k <= n:
                flg = True
                break
if flg:
    print(i, j, k)
else:
    print(-1, -1, -1)

### FIXED CODE ###

import sys

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

# n, y = 1000, 1234000

flg = False
for i in range(y//10000 + 1):
    for j in range(n-i+1):
        k = n - i - j
        if i*10000+j*5000+k*1000 == y:
            print(i, j, k)
            sys.exit(0)
print('-1 -1 -1')
import sys
from collections import Counter
inputs = sys.stdin.readlines()

n = int(inputs[0])
A = list(map(int, inputs[1].split()))
MOD = 998244353
B = [v for k, v in sorted(Counter(A).items())]
if A[0] != 0 or not all(A[1:]) or not all(m):
    print(0)
else:
    t, r = 1
    for b in B:
        t *= pow(r, b, MOD) % MOD
        r = b
    print(t)

### FIXED CODE ###

from collections import Counter
inputs = open(0).readlines()

n = int(inputs[0])
*D, = map(int, inputs[1].split())
mod = 998244353

nbs = [0] * (max(D)+1)
for k, v in Counter(D).items():
    nbs[k] = v

if D[0] != 0 or nbs[0] != 1:
    print(0)
else:
    ans = 1
    for n0, n1 in zip(nbs, nbs[1:]):
        ans = ans * pow(n0, n1, mod) % mod
    print(ans)
s = int(input())
w = int(input())

if s<=w:
  print('unsafe')
else:
  print('safe')

### FIXED CODE ###

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

if s<=w:
  print('unsafe')
else:
  print('safe')
#ABC102C
N=int(input())
A=list(map(int, input().split()))
B=[0]*N
b=0
ans=0
for i in range(N):
    B[i]=A[i]-(i+1)
B_sorted=sorted(B)
if N%2==0:
    b=(B[N/2]+B[N/2-1])//2
else:
    b=(B[N//2])
for i in range(N):
    ans+=A[i]-(b+i+1)
print(ans)

### FIXED CODE ###

#ABC102C
N=int(input())
A=list(map(int, input().split()))
B=[0]*N
b=0
ans=0
for i in range(N):
    B[i]=A[i]-(i+1)
B_sorted=sorted(B)
if N%2==0:
    b=(B_sorted[int(N/2)]+B_sorted[int(N/2-1)])//2
else:
    b=(B_sorted[N//2])
for i in range(N):
    ans+=abs(A[i]-(b+i+1))
print(int(ans))
import math
a=int(input())
print(('%0.5f' % (math.pi*r**2)) + " " + ('%0.5f' % (2*math.pi*r)))

### FIXED CODE ###

import math
r = float(input())
print(('%0.5f' % (math.pi*r**2)) + " " + ('%0.5f' % (2*math.pi*r)))
n,k= map(int,input().split())
td=[]
for i in range(n):
    td.append(list(map(int,input().split())))
td.sort(key=lambda x:x[1],reverse=True)
select=td[:k]
cat=list(set([tdi[0] for tdi in select]))
noselect=[]
tdk=td[k:]
tdk.sort(key=lambda x:x[0])
noselect.append(tdk[0])
for no in tdk[1:]:
    if no[0] != noselect[-1][0]:
        noselect.append(no)
        continue
    if no[1] > noselect[-1][1]:
        noselect[1]=no[1]

rs = sum([tdi[1] for tdi in select])+len(set([tdi[0] for tdi in select]))**2
for i in range(1,min(k,len(noselect)+1)):
    t = select[:-i]
    t[k-i:k-i] = noselect[:i]
    r = sum([tdi[1] for tdi in t])
    r += len(set([tdi[0] for tdi in t]))**2
    if rs < r:
        rs = r
print(rs)

### FIXED CODE ###

n,k= map(int,input().split())
td=[]
for _ in range(n):
    td.append(list(map(int,input().split())))
td.sort(key=lambda x:x[1],reverse=True)
NEW=[1]*(n+1)
x=0
y=0
TOP=[]
SUB=[]
A=[]
for tdi in td[:k]:
    if NEW[tdi[0]]==1:
        NEW[tdi[0]]=0
        TOP.append(tdi[1])
        y+=1
    else:
        A.append(tdi[1])
    x+=tdi[1]
    
for tdi in td[k:]:
    if NEW[tdi[0]]==1:
        SUB.append(tdi[1])
        NEW[tdi[0]]=0
ans=x+y**2
for i in range(min(k-1,len(A),len(SUB))):
    x -= A.pop()
    x += SUB[i]
    y += 1
    ans = max(ans,x+y**2)
print(ans)
n = int(input())

alphabet = [chr(i) for i in range(ord('a'), ord('z')+1)]

alphabet.insert(0,0)

ans = ''
while n > 0:
    ans += alphabet[n%26]
    n = n//26

print(ans[::-1])


### FIXED CODE ###


n = int(input())

alphabet = [chr(i) for i in range(ord('a'), ord('z')+1)]

ans = ''
while n > 0:
    n -= 1
    ans += alphabet[n%26]
    n = n//26

print(ans[::-1])
def dfs(u,c):
  nc=(c+1)%3
  for v in to[u]:
    if d[v][nc]<d[u][c]+1: continue;
    d[v][nc]=d[u][c]+1
    dfs(v,nc)


def main():
  for i in range(m):
    u,v=map(lambda x:int(x)-1,input().split())
    to[u].append(v)
  s,t=map(lambda x:int(x)-1,input().split())

  d[s][0]=0
  dfs(s,0)
  
  #print(d)
  ans=d[t][0]
  print(ans//3 if ans!=INF else -1)

  
if __name__=='__main__':
  n,m=map(int,input().split())
  INF=10**9
  d=[[INF]*3 for i in range(n)]
  to=[[] for i in range(n)]
  s=t=0
  main()

### FIXED CODE ###

from collections import deque

def main():

  n,m=map(int,input().split())
  INF=10**9
  d=[[INF]*3 for i in range(n)]
  to=[[] for i in range(n)]
  for i in range(m):
    u,v=map(lambda x:int(x)-1,input().split())
    to[u].append(v)
  s,t=map(lambda x:int(x)-1,input().split())

  #print(to)
  # calc d (after 3 times dist)
  d[s][0]=0
  cnt=0
  q=deque([(s,cnt)])
  while q:
    u,c=q.popleft()
    for v in to[u]:
      nc=(c+1)%3
      if d[v][nc]!=INF: continue;
      d[v][nc]=d[u][c]+1
      q.append((v,nc))
      
  #print(d)
  ans=d[t][0]
  print(ans//3 if ans!=INF else -1)

  
if __name__=='__main__':
  main()
n=input()
satis=[]
 
for i in range(n):
	satis.append(list(map(int,input().split())))
 
#n=3
#satis=[10, 40, 70, 20, 50, 80, 30, 60, 90]
 
tempA=satis[0]
tempB=satis[1]
tempC=satis[2]
if n > 1:
  for i in range(n-1):
    tempA2=satis[3*i+3]+max([tempB,tempC])
    tempB2=satis[3*i+4]+max([tempA,tempC])
    tempC2=satis[3*i+5]+max([tempA,tempB])
    tempA=tempA2
    tempB=tempB2
    tempC=tempC2
   print(max([tempA,tempB,tempC]))
else:
  print(max([tempA,tempB,tempC]))

### FIXED CODE ###

n=int(input())
satis=[]

for i in range(n):
  A=list(map(int,input().split()))
  satis.extend(A)

tempA=satis[0]
tempB=satis[1]
tempC=satis[2]
if n > 1:
  for i in range(n-1):
    tempA2=satis[3*i+3]+max([tempB,tempC])
    tempB2=satis[3*i+4]+max([tempA,tempC])
    tempC2=satis[3*i+5]+max([tempA,tempB])
    tempA=tempA2
    tempB=tempB2
    tempC=tempC2
  print(max([tempA,tempB,tempC]))
else:
  print(max([tempA,tempB,tempC]))
str = input()
if "a" in str and "b in str and "c"  str:
  print("Yes")
else: 
  print("No")

### FIXED CODE ###

str = input()
if "a" in str and "b" in str and "c"  in str:
  print("Yes")
else: 
  print("No")
a,b,c,d = map(int,input().split())
a -= 1
from math import gcd
divac = a // c
divad = a // d
divbc = b // c
divbd = b // d
divacd = a // (c*d//gcd(c,d))
divbcd = b // (c*d//gcd(c,d))
Acd = divac + divad - divacd
Bcd = divbc + divbd - divbcd
wareru = Bcd - Acd
ans = b-a-wareru
print(ans)


### FIXED CODE ###

a,b,c,d = map(int,input().split())
a -= 1
from fractions import gcd
divac = a // c
divad = a // d
divbc = b // c
divbd = b // d
divacd = a // (c*d//gcd(c,d))
divbcd = b // (c*d//gcd(c,d))
Acd = divac + divad - divacd
Bcd = divbc + divbd - divbcd
wareru = Bcd - Acd
ans = b-a-wareru
print(ans)
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=0
sort(p)
for i range k:
    s+=p[i]

print(s)

### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
s=0
p.sort()
for i in range(k):
    s+=p[i]

print(s)
K = int(input())
N = 50
s = N * (N-1) // 2
A = [a + i + (1 if i >= N-b else 0) for i in range(N)]
print(N)
print(*A)


### FIXED CODE ###

K = int(input())
N = 50
s = N * (N-1) // 2
a = K // N
b = K % N
A = [a + i + (1 if i >= N-b else 0) for i in range(N)]
print(len(A))
print(*A)
A=input()
B=list(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)
for i in range(26):
  if B[i] not in A:
    print(B[i])
    exit()
print("None")

### FIXED CODE ###

A=input()
B=list("abcdefghijklmnopqrstuvwxyz")
for i in range(26):
  if not B[i]  in A:
    print(B[i])
    exit()
print("None")
#!/usr/bin/python
# -*- coding: utf-8 -*-


a,b = input()
print "%d %d"% (a*b, 2*(a+b))

### FIXED CODE ###

a,b = map(int,raw_input().split())
print "%d %d"% (a*b, 2*(a+b))
N,K = map(int,input().split())

price = list(map(int,input(),split()))

price.sort()

for p in range(1,K):
	ans  += price[p]

print(ans)


### FIXED CODE ###

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

price = list(map(int,input().split()))

price.sort()

ans = sum(price[:K])
print(ans)
d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
    s=input()
    print(7 - d.index(s))

### FIXED CODE ###

d='SUN,MON,TUE,WED,THU,FRI,SAT'.split(',')
s=input()
print(7 - d.index(s))
head = input().split(" ")
while head != "0 0 0":
    num = int(head[0])
    mini = int(head[1])
    maxi = int(head[2]) 

    scores = []

    gaps = []

    for i in range(int(head[0])):
        scores.append(int(input()))
    
    for i in range(mini, maxi):
        oks = scores[:i]
        ngs = scores[i:]
        gap = oks[-1] - ngs[0]
        gaps.append((i,gap))

    filtered = list(filter(lambda x: x[1] == max(gaps), gaps))
    sorted(filtered, lambda x: x[0], True)
    print(filtered[0][0])


### FIXED CODE ###

while True:
    num, mini, maxi = map(int, input().split())
    if num == 0: break
    scores = [ int(input()) for i in range(num) ]
    gap = 0
    ans = 0
    for i in range(mini, maxi + 1):
        gap = scores[i-1] - scores[i] if scores[i-1] - scores[i] >= gap else gap
        ans = i if scores[i - 1] - scores[i] >= gap else ans

    print(ans)
N, M = input().split()
A = 0.25
B = (0.25 / int(M))

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



E = sum(x > int(D) for x in C)
print(E)

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
X, Y, Z =  input().split()
# スペース区切りの整数の入力

# 文字列の入力

# 出力
print("{} {} {}".format(Z, X, Y))
from collections import Counter

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

sc = [[0,0] for _ in range(M)]
X = [0 for _ in range(N)]

for i in range(M):
    sc[i][0],sc[i][1] = map(int,input().split())
    
def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

sc = get_unique_list(sc)



sc_0 = [0 for _ in range(len(sc))]
judge = True

for i in range(len(sc)):
    sc_0[i]= sc[i][0]

cnt_sc0 = Counter(sc_0)
for i in sc_0:
    if cnt_sc0[i]> 1:
        judge = False
        break
    
for i in range(len(sc)):
    X[sc[i][0]-1] = sc[i][1]

for i in range(len(X)):
    if X[i] >= 1:
        x = X[i:]
        break

if len(x)==N and judge==True:
    print(int("".join(map(str,x))))
else:
    print(-1)


### FIXED CODE ###

N, M = map(int,input().split())
s = []

for i in range(M):
    s.append(list(map(int,input().split())))

for num in range(1000):
    str_num = str(num)
    if len(str_num) != N:
        continue
    
    flag = True
    for i in range(M):
        keta = s[i][0]
        if str_num[keta - 1] != str(s[i][1]): 
            flag = False
    if flag:
        print(num)
        exit()

print(-1)
import sys
import bisect
from collections import defaultdict
input = sys.stdin.buffer.readline

H, W, N = map(int, input().split())
block = [defaultdict(int) for _ in range(W+1)]
for _ in range(N):
    x, y = map(int, input().split())
    block[y][x] = 1
for w in range(1, W+1):
    block[w][H+1] = 1

h, w = 1, 1
ans = min(list(block[1].keys())) - 1
if ans <= 1:
    print(1)
    exit()
while True:
    if block[w][h+1] == 1:
        ans = min(ans, h)
        break
    h += 1
    if w == W:
        break
    if block[w+1][h] == 0:
        w += 1
        block_w = []
        for k in block[w].keys():
            if block[w][k] == 1:
                block_w.append(k)
        hmin = block_w[bisect.bisect_left(block_w, h)]
        ans = min(ans, hmin-1)

print(ans)


### FIXED CODE ###

import sys
import bisect
from collections import defaultdict
input = sys.stdin.buffer.readline

H, W, N = map(int, input().split())
block = [defaultdict(int) for _ in range(W+1)]
for _ in range(N):
    x, y = map(int, input().split())
    block[y][x] = 1
for w in range(1, W+1):
    block[w][H+1] = 1

h, w = 1, 1
ans = min(list(block[1].keys())) - 1
if ans <= 1:
    print(1)
    exit()
while True:
    if block[w][h+1] == 1:
        ans = min(ans, h)
        break
    h += 1
    if w == W:
        break
    if block[w+1][h] == 0:
        w += 1
        block_w = []
        for k in block[w].keys():
            if block[w][k] == 1:
                block_w.append(k)
        block_w.sort()
        hmin = block_w[bisect.bisect_left(block_w, h)]
        ans = min(ans, hmin-1)

print(ans)
N = int(input())
dict = {}
nums = list(map(int, input().split()))

for num in nums:
  if num in dict.keys():
    dict[num] += 1
  else:
    dict[num] = 1
ans = 0
for key, value in dict.items():
  if int(key) == value
    continue
  elif int(key) > value:
    ans += value
  else:
    ans += value - int(key)
print(ans)

### FIXED CODE ###

N = int(input())
dict = {}
nums = list(map(int, input().split()))

for num in nums:
  if num in dict.keys():
    dict[num] += 1
  else:
    dict[num] = 1
ans = 0
for key, value in dict.items():
  if int(key) == value:
    continue
  elif int(key) > value:
    ans += value
  else:
    ans += value - int(key)
print(ans)
def main():
    k,n = map(int,input().split())
    pos = list(map(int, input().split()))
    dist[]
    for i in range(n-1):
        dist.append(pos[i+1] - pos[i])
    dist.append(k-pos[n]+pos[0])

    print(k - max(dist))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    k,n = map(int,input().split())
    pos = list(map(int, input().split()))
    dist = []
    for i in range(n-1):
        dist.append(pos[i+1] - pos[i])
    dist.append(k-pos[n-1]+pos[0])
    print(k - max(dist))

if __name__ == '__main__':
    main()
print(24 - int(input())

### FIXED CODE ###

M = int(input())
print(48 - M)
N=int(input())
data=list(map(int,input().split()))

for i in range(N):
    mo2=data[i]%2
    mo6=data[i]%6
    mo10=data[i]%10
    if mo2==0:
        if mo6==0 or mo10==0:
            ans="APPROVED"

        else:
            ans="DENIED"
            break

print(ans)

### FIXED CODE ###

N=int(input())
data=list(map(int,input().split()))
ans="APPROVED"
for i in range(N):
    mo2=data[i]%2
    mo6=data[i]%6
    mo10=data[i]%10
    if mo2==0:
        if mo6==0 or mo10==0:
            ans="APPROVED"

        else:
            ans="DENIED"
            break
    else:
        continue
print(ans)
n,k,q=map(int,input().split())
l=[k]*n
m=[0]*n
ans=0
for i in range(q):
    answer=int(input())
    m[answer-1]+=1
for _ in range(q):
    if l[_]-q+m[_]>0:
        ans+=1
print(ans)


### FIXED CODE ###

n,k,q=map(int,input().split())
m=[0]*n
ans=0
for i in range(q):
    answer=int(input())
    m[answer-1]+=1
for _ in range(n):
    if k-q+m[_]>0:
        print("Yes")
    else:
        print("No")
N = input()
A = input()
B = input()
C = input()
D = input()
E = input()
mLsit = [A, B, C, D, E]
m = min(mList)
if N % m == 0:
    print(N // m)
else:
    print(N // m + 1)

### FIXED CODE ###

N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
m = min(A, B, C, D, E)
if N % m == 0:
    print(N // m + 4)
else:
    print(N // m + 5)
a = int(input())
b = int(input())
print(max(a+b,a-b,a*b))

### FIXED CODE ###

a,b = [int(x) for x in input().split()]
print(max(a+b,a-b,a*b))
a =map(int, input().split())
print(a[0]*a[1], sum(a))


### FIXED CODE ###

a,b = [int(x) for x in input().split()]
print(a*b,2*(a+b))
a, b, c, d = map(int, input().split())
while 1:
    c -= b
    if(a <= 0):
        print("Yes")
        break
    a -= d:
    if(d <= 0):
        print("No")
        break

### FIXED CODE ###

import math
a, b, c, d = map(int, input().split())
if math.ceil(c / b) <= math.ceil(a / d):
  print("Yes")
else:
  print("No")
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

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

lcm_A = float(lcm_list(A))

B = [None]*N
for i in range(N):
    B[i] = lcm_A/A[i]

print(int(sum(B)%(10**9+7)))

### FIXED CODE ###

import fractions
import functools
import sys

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return functools.reduce(lcm_base, numbers, 1)
"""
def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
"""
N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

lcm_A = functools.reduce(lcm_base, A, 1)
B = [None]*N
B = [lcm_A//a for a in A]
#B[i] = lcm_A//A[i]

print(sum(B)%(10**9+7))
a,b,c = list(map(int,input().split()))
a = a//c
b = b//c if b%x else b//c-1
print(a-b)

### FIXED CODE ###

l = list(map(str,input().split()))
v = ''
for i in range(len(l)):
    v = v + l[i][0]
print(v)
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

ans = 0
a = 0
b = 0

for i in range(len(s)):
    a += s[i]
    if a == b:
        continue
    ans += 1
    b = a
    a = ""

print(ans)

### FIXED CODE ###

import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

s = input()

ans = 0
a = ""
b = ""

for i in range(len(s)):
    a += s[i]
    if a == b:
        continue
    ans += 1
    b = a
    a = ""

print(ans)
N,A,B=map(int,input().split())
List=""
while len(List) < N:
    List=List+"b"*A
    List=List+"r"*B
if len(List) >= N:
  ans=List[:N]
  print(ans.count("b"))


### FIXED CODE ###

N,A,B=map(int,input().split())
print(N//(A+B)*A+min(A,N%(A+B)))
n,q=map(int,input().split())
s=list(input())
#print(s)
i=0
a=[]
x=0
while i!=n:
 #if n<10000:

    if s[i]=="C" and a1==1:
        x=x+1
        a1=0
    elif s[i]=="A":
        a1=1
    else:
        a1=0
    i=i+1
    a.append(x)

#print(a)
i=0
while i!=q:
  try:
    l,r=map(int,input().split())
    i=i+1
    s=a[r-1]-a[l-1]
    print(s)
  except:
      break


### FIXED CODE ###

n,q=map(int,input().split())
s=list(input())
#print(s)
i=1
a=[0]
x=0
while i!=n:
    if s[i-1]=="A":
        if s[i]=="C":
            x=x+1
    i=i+1
    a.append(x)

#print(a)
i=0
while i!=q:
  try:
    l,r=map(int,input().split())
    i=i+1
    s=a[r-1]-a[l-1]
    print(s)
  except:
      break