peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n, m = map(int,input().split())
SC = [list(map(int, input().split())) for _ in range(m)]

def check(num):
    num = str(num)
    if len(num) != n:
        return False

    for s, c in SC:
        if num[s-1] != str(c):
            return False
    return True


for i in range(1000):
    if check(i):
        print(i)
        exit()
print(-1)
# Judge status: Wrong Answer
import sys

x = int(input())

for i in range(-100, 100):
    for j in range(-100, 100):
        if i ** 5 - j ** 5 == x:
            print('{} {}'.format(i, j))
            sys.exit()
# Judge status: Accepted
N=int(input())
print(N*800-200*(N//15))
# Judge status: Wrong Answer
N = int(input())
cnt = 0
for i in range(N):
  if N%2:
    cnt += 1
print(cnt/N)
# Judge status: Wrong Answer
N = int(input())
A = []
my_max = 0
for _ in range(N):
    a = int(input())
    A.append(a)
    my_max = max(my_max, a)

max_count = A.count(a)

if max_count > 1:
    [print(my_max) for _ in range(N)]
else:
    my_next_max = max([a for a in A if a != my_max])
    [print(my_max) if a != my_max else print(my_next_max) for a in A]
# Judge status: Accepted
s = input()

if (s[0] != 'A'):
   print('WA')
   exit()

t = s[2:-1]
if ('C' not in t or t.count('C') > 1):
   print('WA')
   exit()

s = s[1:]
s = s.replace('C', '')
for x in s:
   if (x.islower() == False):
      print('WA')
      exit()
print('AC')
# Judge status: Accepted
N = int(input())
print(N // 2 + 1 if N % 2 else N // 2)
# Judge status: Accepted
a, b, ab, x, y = map(int, input().split())

min_value = a * x + b * y

max_num = max(x, y)

for i in range(2, max_num * 2 + 1, 2):
    # print(i)
    value = ab * i + a * max(0, x - i // 2) + b * max(0, y - i // 2)
    # print(value)
    min_value = min(min_value, value)

print(min_value)
# Judge status: Wrong Answer
N = int(input())

ans = 0

if N % 2 == 0:
    num = 5
    temp_N = N/2
    while num < temp_N:
        ans += temp_N//num
        num *= 5


print(int(ans))
# Judge status: Wrong Answer
s = input()
print('yes' if list(s) == set(list(s)) else 'no')
# Judge status: Accepted
n, k = map(int, input().split())
A = list(map(int, input().split()))

for i in range(1, 100):
  imos = [0] * (n + 1)
  for j in range(n):
    imos[max(0, j - A[j])] += 1
    imos[min(n, j + A[j] + 1)] -= 1
  
  nA = [0] * n
  nA[0] = imos[0]
  for j in range(1, n):
    nA[j] = nA[j - 1] + imos[j]

  A = nA[:]
  if i >= k:
    break

print(*A)
# Judge status: Accepted
n, q = map(int, input().split())
s = input()

ac_counter = [0] * n
counter = 0
for i in range(n - 1):
    # ac_counter[i] = counter
    if s[i:i+2] == "AC":
        counter += 1
    ac_counter[i + 1] = counter

for i in range(q):
    l, r = map(int, input().split())
    print(ac_counter[r - 1] - ac_counter[l - 1])
# print(ac_counter)
# Judge status: Accepted
N = int(input())
for x in range(1, 5 * 10000 + 1):
    if int(x * 1.08) == N:
        print(x)
        break
else:
    print(":(")
# Judge status: Wrong Answer
def main():
    cnt = 0
    s = 0
    y = ""
    a = ""
    for i in input()[::-1]:
        a += i
        k = int(i)
        if k + s <= 5:
            cnt += k + s
            y += str(k + s)
            s = 0
        else:
            cnt += 10 - k - s
            y += "0"
            s = 1
    if s == 1:
        y += "1"
    print(cnt + s)

if __name__ == '__main__':
    main()
# Judge status: Accepted
s=input()
k=int(input())
ans=''
for i in range(len(s)-1):
  if s[i]=='a':
    ans+='a'
  else:
    if k>=123-ord(s[i]):
      k-=(123-ord(s[i]))
      ans+='a'
    else:
      ans+=s[i]
ans+=chr((ord(s[-1])-97+k)%26+97)
print(ans)
# Judge status: Accepted
import sys
s=input()
k=int(input())
for i in range(k):
  if s[i]!="1":
    print(s[i])
    sys.exit()
print(1)
# Judge status: Wrong Answer
a,b = map(int,input().split())

if a * b <= 0:
    print(0)
elif a > 0:
    print("Positive")
else:
    if (b - a) % 2 == 0:
        print("Negative")
    else:
        print("Positive")
# Judge status: Accepted
n = input()

n = str(sum([int(i) for i in n]))
n = str(sum([int(i) for i in n]))
if int(n)%9==0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]
c = [list(map(int, input().split())) for _ in range(m)]

for i in a:
    mn = 10 ** 8
    record = 0
    for j, v in enumerate(c):
        temp = abs(i[0] - v[0]) + abs(i[1] - v[1])
        if temp < mn:
            mn = temp
            record = j + 1
    print(record)
# Judge status: Wrong Answer
import sys
N, M = map(int, sys.stdin.readline().split())
LR = sorted([list(map(int,sys.stdin.readline().split())) for i in range(M)])
if LR[0][1] - LR[M-1][0] >= 0:
    print(LR[0][1] - LR[M-1][0] + 1)
else:
    print(0)
# Judge status: Accepted
S = list(input())
print('yes' if len(set(S)) == len(S) else 'no')
# Judge status: Wrong Answer
K, A, B = map(int, input().split())
if B - A <= 2 :
  print(K + 1)
elif K < A + 1:
  print(K + 1)
elif K == A + 1:
  print(B)
# Judge status: Accepted
S = input()
s1 = int(S[:2])
s2 = int(S[2:])
def is_MM(s):
    return 1 <= s <= 12

if is_MM(s1) and is_MM(s2):
    print('AMBIGUOUS')
elif is_MM(s1):
    print('MMYY')
elif is_MM(s2):
    print('YYMM')
else:
    print('NA')
# Judge status: Wrong Answer
p, q, r = map(int, input().split())
print(min(p+q, q+r, q+p))
# Judge status: Accepted
#120_A
A,B,C=map(int,input().split())
print(min(C,B//A))
# Judge status: Accepted
import collections
s = input()
c = collections.Counter(s)

if c["a"] == c["b"] == c["c"]:
  print("YES")
  exit()
if c["a"]+1 == c["b"] == c["c"]:
  print("YES")
  exit()
if c["a"]-1 == c["b"] == c["c"]:
  print("YES")
  exit()
if c["a"] == c["b"]+1 == c["c"]:
  print("YES")
  exit()
if c["a"] == c["b"]-1 == c["c"]:
  print("YES")
  exit()
if c["a"] == c["b"] == c["c"]+1:
  print("YES")
  exit()
if c["a"] == c["b"] == c["c"]-1:
  print("YES")
  exit()
else:
  print("NO")
# Judge status: Accepted
def chmin(a, b):
  if (a > b):
    return b

  return a

def chmax(a, b):
  if (a < b):
    return b

  return a

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

dp = [[10**9] * (H+1) for i in range(N+1)]
dp[0][0] = 0

for n in range(N):
  for h in range(0, H+1):
    dp[n+1][h] = chmin(dp[n+1][h], dp[n][h])
    dp[n+1][min(h+li[n][0], H)] = chmin(dp[n+1][min(h+li[n][0], H)], dp[n+1][h]+li[n][1])

print(dp[N][H])
# Judge status: Wrong Answer
import queue

n, m = [int(i) for i in input().strip().split()]
to = [[] for _ in range(n)]
for i in range(m):
  a, b = [int(i)-1 for i in input().strip().split()]
  to[a].append(b)
  to[b].append(a)

que = queue.Queue()
dist = [float('inf')]*n
pre = [-1]*n

dist[0] = 0
que.put(0)
while not que.empty():
  v = que.get()
  for u in to[v]:
    if dist[u]!=float('inf'):
      continue
    dist[u] = dist[v] + 1
    pre[u] = v
    que.put(u)

print("yes")
for i in range(1, n):
  print(pre[i]+1)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
s=sum(l)
su=0
for i in range(n):
	s=s-l[i]
	s=s%1000000007
	su=su+(l[i]*s)
	su=su%1000000007
print(su)
# Judge status: Accepted
A, B, C = map(int, input().split())
if A % 2 == 0 or B % 2 == 0 or C % 2 == 0:
    print(0)
else:
    print(A * B * C // max(A, B, C))
# Judge status: Accepted
import math
import sys


def lcm(a, b):
  return a * b // math.gcd(a, b)


input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))
LCM = 1
ans = 0
MOD = 1000000007
for x in A:
  LCM = lcm(LCM, x)
for x in A:
  ans += LCM // x

print(ans%MOD)
# Judge status: Wrong Answer
S = list(input())
K = int(input())

ref = 0
for i in range(len(S)):
    if S[i] == "1":
        ref += 1
    else:
        break

ans = ""
if ref == 0:
    ans = S[0]
else:
    if ref >= K:
        ans = "1"
    else:
        ans = S[1]

print(ans)
# Judge status: Accepted
A, B = map(int, input().split())

ans = 0

for _ in range(2):
  if A >= B:
    ans += A
    A -= 1
  else:
    ans += B
    B -= 1
    
print(ans)
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())
count=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k==x:
                count+=1
print(count)
# Judge status: Wrong Answer
n,m=map(int,input().split())
if n>= m*2:
    print(m//2);exit()
ans=n
m= m-2*n ; n=0

print(ans+m//4)
# Judge status: Accepted
import bisect
from collections import deque
N = int(input())
A = [int(input()) for _ in range(N)]
c = deque()
c.append(A[0])
for i in range(1, N):
    j = bisect.bisect_left(c, A[i])
    if j == 0:
        c.appendleft(A[i])
    else:
        c[j-1] = A[i]
print(len(c))
# Judge status: Accepted
n = int(input())
L = list(map(int, input().split()))
L.sort()
count = 0
for i in range(n - 1, 1, -1):
    l = 0
    r = i - 1
    while l < r:
        if L[i] < L[r] + L[l]:
            count += r - l
            r -= 1
        else:
            l += 1
print(count)
# Judge status: Wrong Answer
a = input()
b = a[0:4]
f = a[5:7]
c = int(a[-2:])
b = "2018"

print(b + "/" + f + "/" + str(c))
# Judge status: Accepted
#cited by maspy
A = [int(input()) for _ in range(5)]
 
ceiled = [(x+9)//10*10 for x in A]
can_save = [y - x for x,y in zip(A,ceiled)]

answer = sum(ceiled) - max(can_save)
print(answer)
# Judge status: Wrong Answer
S=input()
print("S[0]"+"S[1]"+"S[2]")
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]
ans = "No"
for i in range(n-m+1):
    for j in range(n-m+1):
        flag = True
        for k in range(m):
            if a[k][:m]!=b[k]:
                flag = False
                break
        if flag:
            ans = "Yes"
            break
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
def main():
    N, K = map(int, input().split())
    h = [int(input()) for i in range(N)]
    H = sorted(h)
    ans = H[N-1] - H[N-K]
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
# input
N = int(input())
S = input()

# check
if N < 2 or N % 2 != 0:
    print("No")
else:
    if N == 2:
        right = S[0]
        left = S[1]
    else:
        c = N // 2
        right = S[0:c]
        left = S[c:]

    if right == left:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
s=input()
t=input()
s=sorted(s)
t=sorted(t)
if s<t:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = input()
if "9" in N:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n - k):
    if a[i] < a[i + k]:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
num0 = 0
num1 = sum(a)

ans = 10**10
for i in range(0, N):
    num0 += a[i]
    num1 -= a[i]
    if ans > abs(num1-num0):
        ans = abs(num1-num0)
    else:
        break
print(ans)
# Judge status: Accepted
N = int(input())
A = [0]*N
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            a = x**2+y**2+z**2+x*y+z*x+y*z
            if a <= N:
                A[a-1]+= 1
for a in A:
    print(a)
# Judge status: Accepted
import math
n = int(input())
print(n *2 * math.pi)
# Judge status: Wrong Answer
n = list(map(int,input().split()))

if n[0] == n[1] == n[2]:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
# -*- coding: utf-8 -*-

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

count = [0] * (10**5+1)

for i in range(N):
    count[a[i]] += 1
    if a[i]-1 >=0:
        count[a[i]-1] += 1
    if a[i]+1 <=10**5:
        count[a[i]+1] += 1

max_value = max(count)
#max_index = count.index(max_value)
print(max_value)
# Judge status: Accepted
N=int(input())
count = 0
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()　#小さい順位欲しいとき
    return divisors
for i in range(1,N+1):
    if len(make_divisors(i))==8 and i%2==1:
        count += 1
print(count)
# Judge status: Accepted
N, K = map(int, input().split())

line = input()
S = list(i for i in line)
S[K - 1] = S[K - 1].lower()

print("".join(S))
# Judge status: Accepted
import math

n, d = map(int, input().split())
x = []
for _ in range(n):
    x.append(list(map(int, input().split())))

count = 0
for i in range(n-1):
    for j in range(i+1, n):
        ans = 0
        for k in range(d):
            ans += (x[i][k] - x[j][k])**2
        if math.sqrt(ans).is_integer():
            count += 1

print(count)
# Judge status: Wrong Answer
n = int(input())

num = [1, 2, 3, 4, 5, 6, 7, 8, 9]

ans = 0
for i in range(len(num)):
    if n%(num[i]) == 0 and n//(num[i]) <= 9:
        ans = 1
if ans == 1:
    print("Yes")
else:
    print("NO")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
ans = 0
y = []
x = 0
z = 1
while x == 0:
    for i in range(N):
        a = str(A[i] % (2 ** z))
        y.append(a)
    if y.count('0') == N:
        ans += 1
        y = []
        z += 1
    else:
        x =+ 3
print(ans)
# Judge status: Accepted
s=input()
print(s.replace("?", "D"))
# Judge status: Wrong Answer
l = input ().split ()
list.sort (l, reverse=True)
a = l[0]
b = l[1]
c = l[2]
if a+b == c:
  print ('Yes')
else:
  print ('No')
# Judge status: Accepted
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)

mod=1000000007
n=input();
arr = list(map(int, raw_input().split()))
l=arr[0];
for i in arr:
    x=gcd(l,i)
    l=(l*i)/x
    
ans=0
#print l
for i in arr:
    b=l/i
    ans+=b
ans=(ans%mod +mod)%mod
print ans
# Judge status: Accepted
n,x = list(map(int, input().split()))
a = sorted(list(map(int, input().split())))
cnt=0
for i,X in enumerate(a):
    if x>=X:
        cnt+=1
        x-=X
    else:
        break
if cnt==n and x>0:
    cnt-=1
print(cnt)
# Judge status: Accepted
alph = ['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']

N = int(input())
S = input()

new = ""
for s in S:
    idx = alph.index(s)
    new += alph[N - (len(alph) - idx)]
print(new)
# Judge status: Wrong Answer
import copy

n = int(input())
l = list(map(int,input().split()))
p1 = n//2
p2 = n//2-1
ans = copy.copy(l)
ans.sort()

for i in l:
    if i >= l[p1]:
        print(ans[p2])
    else:
        print(ans[p1])
# Judge status: Accepted
# -*- coding: utf-8 -*-
from sys import stdin
input = stdin.readline
import numpy as np

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


temp = 1e+9
for i in range(N):
    res = np.array(W[:i]).sum()
    pos = np.array(W[i:]).sum()

    if(abs(res - pos) < temp):
        temp = abs(res - pos)

print(temp)
# Judge status: Wrong Answer
N = int(input())
n6 = 1
n9 = 1
li = []
while 9**n9 < N:
    li.append(9**n9)
    n9 += 1
while 6**n6 < N:
    li.append(6**n6)
    n6 += 1

li.sort()
INF = 10**10
# 1円の場合はね
dp = [[i for i in range(N+1)] for i in range(len(li) + 1)]
dp = [i for i in range(N+1)]


for i,l in enumerate(li):
    for j in range(N+1):
        if j+l > N : continue
        dp[j+l] = min(dp[j+l], dp[j]+1)
    # print(dp)
print(dp[N])
# Judge status: Accepted
s = input()
n = len(s)
ans = 10000
for i in range(n-2):
  x = int(s[i:i+3])
  ans = min(ans, abs(753-x))
print(ans)
# Judge status: Wrong Answer
S = list(input())
T = list(input())

s_len = len(set(S))
t_len = len(set(T))

if s_len == t_len:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*n
for i in range(1,n):    
    start=max(0,i-k)
    dp[i]=min(dp[j]+abs(l[i]-l[j]) for j in range(start,i))
print(dp[-1])
# Judge status: Accepted
from decimal import Decimal

a, b, c = map(Decimal, input().split())
if a.sqrt() + b.sqrt() < c.sqrt():
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a = int(input())

if a > 30:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n, t = map(int, input().split())
c = 10000
for i in range(n):
    tmp = input().split()
    if t >= int(tmp[1]):
        if int(tmp[0]) < c:
            c = int(tmp[0])
if c == 999:
    print('TLE')
    exit()
else:
    print(c)
# Judge status: Accepted
N, M = map(int, input().split())

if N == 2 or M == 2:
    print(0)

else:
    print(abs((N - 2) * (M - 2)))
# Judge status: Accepted
N = int(input())
P = list(map(int, input().split()))

cnt = 0
ans = 0
t = 'o' if P[0] == 1 else 'x'
for i, p in enumerate(P):
    s = 'o' if p == (i + 1) else 'x'
    if s == t:
        cnt += 1
    else:
        if t == 'o':
            ans += (cnt + 2 - 1) // 2
        cnt = 1
        t = s
else:
    if t == 'o':
        ans += (cnt + 2 - 1) // 2

print(ans)
# Judge status: Accepted
n=int(input())
ans=''
check='abcdefghijklmnopqrstuvwxyz' #c(a)-1=0,c(b)-1=1,…,c(z)-1=25を対応づける文字列
while n!=0:
 n-=1
 ans+=check[n%26] #(n-1)%26がc(Sk)-1を表すので、上記の文字列を用いてc(Sk)-1からSkを求める
 n//=26
print(ans[::-1])
# Judge status: Wrong Answer
M = int(input())
A = list(map(int,input().split()))
B = [0]*(M+1)
C = [0]*2
D = [0]*2
# Judge status: Accepted
n,m=map(int,input().split())
print(abs(m-2)*abs(n-2))
# Judge status: Accepted
N = int(input())
Xlist = list(map(int, input().split()))
X_sort = sorted(Xlist)
left_med = X_sort[N//2-1]
right_med = X_sort[N//2]
for i in range(N):
    if Xlist[i] <= left_med:
        print(right_med)
    else:
        print(left_med)
# Judge status: Wrong Answer
n, k = map(int, input().split())
nums = [list(map(int, input().split())) for _ in range(n)]

cnt = 0
for a, b in nums:
    cnt += b
    if cnt >= k:
        print(a)
        break
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

l = [0] * 100002
for i in a:
    l[i+1] += 1
    l[i+2] += 1
    l[i] += 1
print(max(l))
# Judge status: Wrong Answer
n,m=map(int,input().split())
al=[]
bl=[]
for i in range(m):
  a,b=map(int,input().split())
  al.append(a)
  bl.append(b)

for i in range(m+1):
  print(al.count(i)+bl.count(i))
# Judge status: Wrong Answer
a, b = map(str, input().split())
num = int(a+b)
flag = False
for i in range(1, 101):
    if i*i > num:
        break
    elif i*i == num:
        print("Yes")
        flag = True
        break
if not flag:
    print("No")
# Judge status: Accepted
a,b=5,10
for i in range(5):
    i=int(input())
    a+=(i-1)//10
    if 0<i%10<b:
        b=i%10
print(a*10-(10-b))
# Judge status: Accepted
o=input()
e=input()
moji=""
for i in range(0,len(o)):
  moji+=o[i]
  try:
    moji+=e[i]
  except IndexError:
    pass
print(moji)
# Judge status: Accepted
A, B, K = map(int, input().split())

if A >= K:
    print(A - K, B)
elif A + B >= K:
    print(0, B - (K - A))
else:
    print(0, 0)
# Judge status: Wrong Answer
S=input()
D=['MON','TUE','WED','THU','FRI','SAT','SUN']
for i in range(len(D)):
    if D[i]==S:
        print(i+1)
# Judge status: Accepted
N, A, B = map(int, input().split(" "))

result = 0
for i in range(N+1):
    if A <= sum(map(int, list(str(i)))) <= B:
        result += i
print(result)
# Judge status: Accepted
import sys
import itertools
tokens = itertools.chain.from_iterable(map(str.split, sys.stdin))

yesno = ['No', 'Yes']
d = int(next(tokens))
t = int(next(tokens))
s = int(next(tokens))

ans = yesno[d / s <= t]
print(ans)
# Judge status: Accepted
import fractions
from functools import reduce

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

def lcm_ls(num):
    return reduce(lcm, num, 1)

n = int(input())
ls = [int(input()) for _ in range(n)]

print(lcm_ls(ls))
# Judge status: Wrong Answer
n = int(input())
res = dict()
for i in range(n):
    m = input()
    m = sorted(m)
    m = ''.join(m)
    if m in res:
        res[m] += res[m]
    else:
        res[m] = 1
print(sum(res.values())-len(res))
# Judge status: Accepted
D = int(input())
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas"+" Eve"*2)
else:
  print("Christmas"+" Eve"*3)
# Judge status: Wrong Answer
x = int(input())
print(x+x^2+x^3)
# Judge status: Accepted
import math

N = int(input())

x = math.ceil((math.sqrt(8 * N + 1) - 1) / 2)
S = x * (x + 1) // 2
ex = S - N
for i in range(1, x + 1):
    if i != ex:
        print(i)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if b<=c or d<=a:
    print(0)
else:
    time=[]
    time.append(a)
    time.append(b)
    time.append(c)
    time.append(d)
    time.sort()
    print(time[2]-time[1])
# Judge status: Accepted
S = list(input())
N = len(S)
old = S[0]
T = ''
ans = 1
for i in range(1, N):
    if T == '':
        T = S[i]
        if T != old:
            ans += 1
            old = T
            T = ''        
    else:
        T += S[i]
        old = T
        ans += 1 
        T = ''
print(ans)
# Judge status: Accepted
def resolve():
    w = str(input())
    ls = set(w)
    for l in ls:
        if w.count(l) % 2 == 1:
            print('No')
            return

    print('Yes')
    return

resolve()
# Judge status: Wrong Answer
N,A,B=map(int,input().split())
if (B+A)%2==0:
    ans=int((B-A)/2)
else:
    ans=min(A-1,N-B)+1+int((B-A-1)/2)
print(ans)
# Judge status: Wrong Answer
import numpy as np
n,x=map(int,input().split())
p=list(map(int,input().split()))
p.append(x)
p.sort()
p=np.array(p)
p=p-x
p1=np.array(p[1:]-p[:-1])
print(min(p1))
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))

def minimize(list):
    min = 1000000
    for i in range(-100,101):
        num = 0
        for j in range(len(list)):
            num = num + (int(list[j]) - i)**2
        if min >= num:
            min = num
    return min

print(minimize(a))
# Judge status: Accepted
w, h, x, y = map(int, input().split())

s_max = (w * h) / 2
if x == w / 2 and y == h / 2:
    print(s_max, 1)
else:
    print(s_max, 0)
# Judge status: Wrong Answer
n,r=map(int,input().split())
if n>=10:
  print(r)
else:
  R=r-100*(10-n)
  print(R)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

a.sort()
tmp = a[0]
f = True
for i in range(1, n):
    tmp *= a[i]

    if tmp > 10 ** 18:
        f = False
        break

if f:
    print(tmp)
else:
    print(-1)
# Judge status: Wrong Answer
import math
x = int(input())
n = math.ceil(math.sqrt(x*2))
s = [list(map(int,bin(x)[2:].zfill(n))) for x in range(2**n)]
t = 0
c = 0
min = x
for i in range(2**n):
    for j in range(len(s[i])):
        t+=s[i][j]*(j+1)
        if s[i][j]==1:
            c =j+1
    if t==x and c<min:
        min =c
print(c)
# Judge status: Accepted
r=range(10)
print(['No','Yes'][int(input()) in {i*j for i in r for j in r}])
# Judge status: Accepted

a,b,c = map(int,input().split())
d = a-b
if c-d>0:
    print(c-d)
else:
    print(0)
# Judge status: Accepted
N, M = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(M)]
if N == 1:
    ans = 0
else:
    ans = 10 ** (N - 1)
limit = 10 ** N
while ans < limit:
    l = str(ans)
    for s, c in sc:
        if not int(l[s-1]) == c:
            break
    else:
        print(ans)
        exit()
    ans += 1
print(-1)
# Judge status: Accepted
x=input()
s,a=0,0
for i in x:
 if i=="S":
  s+=1
 elif s==0:
  a+=1
 else:
  s-=1
print(a+s)
# Judge status: Wrong Answer
S=input()
print("2018"+S[5:])
# Judge status: Accepted
X = int(input())
A, B = 0, 0
for i in range(-200, 200):
    for j in range(-200, 200):
        if X == i**5 - j**5:
            A = i
            B = j
print(A, B)
# Judge status: Accepted
n = int(input())

for i in range(6,0,-1):
  if n >= 2**i:
    print(2**i)
    exit()
print(1)
# Judge status: Wrong Answer
n = int(input())
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
s1 = [a1[0]]
s2 = [a2[-1]]
for i in range(n-1):
  s1 += [s1[i]+a1[i+1]]
  s2 += [s2[i]+a2[n-i-2]]

ans = 0
for i in range(n):
  ans += max(ans, s1[i] + s2[n-1-i])
print(ans)
# Judge status: Accepted
def main():
    s = int(input())
    p, q = divmod(-s, 10 ** 9)
    print(0, 0, 1, 10 ** 9, abs(p), q)


if __name__ == '__main__':
    main()
# Judge status: Accepted
i = input().split()
a = int(i[0])
b = int(i[1])
if a < 0 and b > 0:
	print("Zero")  
elif a < 0 and b < 0:
	tmp = (a*-1) - (b*-1) + 1
	if tmp % 2 == 0:
		print("Positive")
	else:
		print("Negative")
else:
	print("Positive")