Harryxun/stf_run huggingface dataset:
s = input()

left = 0
right = 0

count = 0
while True:
  if s[right+1] != s[left]:
    count += 1
    right += 1
    left = right
    if right == len(s) - 1:
      break
  else:
    right += 1
    if right == len(s) - 1:
      break

print(count)

### FIXED CODE ###

s = input()

if len(s) == 1:
  print(0)
  exit()

left = 0
right = 0

count = 0
while True:
  if s[right+1] != s[left]:
    count += 1
    right += 1
    left = right
    if right == len(s) - 1:
      break
  else:
    right += 1
    if right == len(s) - 1:
      break

print(count)
import math
a,b,x=map(int,input().split())
c1=a*a*b/2
if x=a*a*b:
    print(0.0)
if x>c1:
    ans=math.atan((a*a*a)/((2*a*a*b)-(2*x)))
    ans=math.degrees(ans)
    print(90-ans)
else:
    ans=math.atan((2*x)/(a*b*b))
    ans=math.degrees(ans)
    print(90-ans)
    

### FIXED CODE ###

import math
a,b,x=map(int,input().split())
c1=a*a*b/2
if x==a*a*b:
    print(0.0)
    exit(0)
if x>c1:
    ans=math.atan((a*a*a)/((2*a*a*b)-(2*x)))
    ans=math.degrees(ans)
    print(90-ans)
else:
    ans=math.atan((2*x)/(a*b*b))
    ans=math.degrees(ans)
    print(90-ans)
n, d = map(int, input().split())
a = n // (2d + 1) + 1
print(a)


### FIXED CODE ###

import math
n, d = map(int, input().split())
se = d * 2 + 1
print(math.ceil(n/se))
import time
while 1:
    e = int(input().strip())
    if e ==0:break
    m=e
    z =0
    time.sleep(20)
    while z**3 <= e:
        y=0
        while y **2 <= e - z**3:
            x = e - y**2 - z**3 
            if m > x+y+z: m = x+y+z 
            y+=1
        z+=1
    
    print(m)


### FIXED CODE ###

import math
while 1:
    e = int(input().strip())
    if e ==0:break
    m=e
    z =0
    while z**3 <= e:
        y = int(math.sqrt(e-z**3))
        x = e - y**2- z**3 
        if x < 0:break
        if m > x+y+z: m = x+y+z    
        z+=1
    print(m)
n,m=map(int,input().split())
count=[0]*m
ans=0
list=[]
for i in range(n):
  list.append(list(map(int,input().split())))
  for j in range(1,list[i][0]+1):
    count[list[i][j]]+=1
for i in range(m):
  if count[i]==n:
    ans+=1
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
count=[0]*m
ans=0
arr=[]
for i in range(n):
  arr.append(list(map(int,input().split())))
  for j in range(1,arr[i][0]+1):
    count[arr[i][j]-1]+=1
for i in range(m):
  if count[i]==n:
    ans+=1
print(ans)
#!/usr/bin/env python3
import sys
import math


def solve(N: int, X: int, x: "List[int]"):
    x.sort()
    gMax = None
    last = None
    begin = 0
    if abs(X - x[0]) > 0:
        last = abs(X-x[0])
        gMax = last
    else:
        begin = 1
        last = x[1]-x[0]
        gMax = last
    for i in range(begin, N-1):
        next = x[i+1] - x[i]
        gMax = math.gcd(gMax, next)
    print(gMax)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, X, x)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import fractions


def solve(N: int, X: int, x: "List[int]"):
    x.sort()
    gMax = None
    last = None
    begin = 0
    if abs(X - x[0]) > 0:
        last = abs(X-x[0])
        gMax = last
    else:
        begin = 1
        last = x[1]-x[0]
        gMax = last
    for i in range(begin, N-1):
        next = x[i+1] - x[i]
        gMax = fractions.gcd(gMax, next)
    print(gMax)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, X, x)


if __name__ == '__main__':
    main()
MOD = 10**9+7
n = int(input())
la = list(map(int,input().split()))
L = [-1]*(n+1)
l = 0
for i in range(n+1):
  a = la[i]
  if L[a] == -1:
    L[a] = i
  else:
    l = i - L[a] - 1
    break
 
MAX = n
factorial = [1, 1]
inverse = [0, 1]
inverse_factorial = [1, 1]
for i in range(2,MAX+1):
  factorial.append( (factorial[-1]*i)%MOD )
  inverse.append( (-inverse[MOD%i]*(MOD//i))%MOD )
  inverse_factorial.append( (inverse_factorial[-1]*inverse[-1])%MOD )
 
def C_MOD(n, k):
  if k < 0 or k > n:
    return 0
  k = min(k,n-k)
  return factorial[n] * inverse_factorial[k] * inverse_factorial[n-k] % MOD
 
print(n)
#print((2*C_MOD(n-1,1)-C_MOD(n-1-l,1)+C_MOD(n-1,2)+1)%MOD)
for i in range(2,n+1):
  if n > l+1:
    print((2*C_MOD(n-1,i-1)-C_MOD(n-1-l,i-1)+C_MOD(n-1,i)+C_MOD(n-1,i-2))%MOD)
  else:
    print((2*C_MOD(n-1,i-1)+C_MOD(n-1,i)+C_MOD(n-1,i-2))%MOD)
print(1)

### FIXED CODE ###

# ringing
a = list(map(int, input().split()))
a = sorted(a)
print( a[0]+a[1] )
n = int(input())
a_list = list(map(int,input().split()))
ans_list = []
for i in range(len(a_list)):
    ans_list.append(a_list[i] - i - 1)
import numpy as np
if len(ans_list)% 2 == 0:
    cary1 = np.delete(ans_list, max(ans_list))
    cary2 = np.delete(ans_list, min(ans_list))
    number1 = int(np.median(cary))
    number2 = int(np.median(cary))
    ans1 = 0
    for i in ans_list:
        ans1 += abs(i - number1)
    ans2 = 0
    for i in ans_list:
        ans2 += abs(i - number2)
    print(min(ans1 , ans2))
    
else:
    cary = ans_list
    number = int(np.median(cary))
    ans = 0
    for i in ans_list:
        ans += abs(i - number)
    print(ans)

### FIXED CODE ###

n = int(input())
a_list = list(map(int,input().split()))
ans_list = []
for i in range(len(a_list)):
    ans_list.append(a_list[i] - i - 1)
import numpy as np
if len(ans_list)% 2 == 0:
    ans_list1 = sorted(ans_list)
    number1 = ans_list1[n//2]
    number2 = ans_list1[n//2 + 1]
    
    ans1 = 0
    ans2 = 0
    for i in ans_list:
        ans1 += abs(i - number1)
        ans2 += abs(i - number2)
    print(min(ans1 , ans2))
else:
    cary = ans_list
    number = int(np.median(cary))
    ans = 0
    for i in ans_list:
        ans += abs(i - number)
    print(ans)
def function(x, a):
  if x < a:
    return 0
  else:
    return 10
  
function(x, a)

### FIXED CODE ###

x, a = (int(i) for i in input().split())
def function(x, a):
  if x < a:
    return 0
  else:
    return 10
  
print(function(x,a))
import math
r = int(raw_input())

print '%f %f' %(r*r*math.pi, 2*r*math.pi)

### FIXED CODE ###

import math
r = float(raw_input())
V = r*r*math.pi
S = 2*r*math.pi

print '%f %f' %(V, S)
y,m,d = map(int, input().split('/'))
ans = True
if y <= 2019:
	if m <= 4:
      if d > 30:
        ans = False
    else:
      ans = False
else:
  ans = False
if ans:
  print("Heisei")
else:
  print("TBD")

### FIXED CODE ###

y,m,d = map(int, input().split('/'))
ans = True
if y <= 2019:
  if m <= 4:
    if d > 30:
      ans = False
  else:
    ans = False
else:
  ans = False
if ans:
  print("Heisei")
else:
  print("TBD")
S = input()
alpha = "abcdefghijklmnopqrstuvwxyz"
invalpha = "zyxwvutsrqponmlkjihgfedcba"
D = {alpha[i]: i for i in range(26)}
E = [0 for i in range(26)]
def sugar(s):
  n = len(s)
  q = 0
  for i in range(n):
    if s[i] == 'z':
      q = i
  return i

for i in range(len(S)):
  E[D[S[i]]] = 1
if min(E) == 0:
  for m in range(26):
    if E[m] == 0:
      S = S[:] + alpha[m]
      break
  print(S)
elif S == "zyxwvutsrqponmlkjihgfedcba":
  print(-1)
else:
  p = 26
  for i in range(25, 0, -1):
    if D[S[i]] < D[S[i-1]]:
      p = i
    else:
      break
  if p == 26:
    S = S[:24] + S[25]
  else:
    m = D[S[p-2]]
    L = []
    for x in range(p, 26):
      if D[S[x]] >= m + 1:
        L.append(S[x])
    L.sort()
    S = S[:p-2] + L[0]
  print(S)

### FIXED CODE ###

S = input()
alpha = "abcdefghijklmnopqrstuvwxyz"
invalpha = "zyxwvutsrqponmlkjihgfedcba"
D = {alpha[i]: i for i in range(26)}
E = [0 for i in range(26)]

for i in range(len(S)):
  E[D[S[i]]] = 1
if min(E) == 0:
  for m in range(26):
    if E[m] == 0:
      S = S[:] + alpha[m]
      break
  print(S)
elif S == "zyxwvutsrqponmlkjihgfedcba":
  print(-1)
else:
  p = 26
  for i in range(25, 0, -1):
    if D[S[i]] < D[S[i-1]]:
      p = i
    else:
      break
  m = D[S[p-2]]
  L = []
  for x in range(p-1, 26):
    if D[S[x]] >= m + 1:
      L.append(S[x])
  L.sort()
  if L != []:
    S = S[:p-2] + L[0]
  else:
    S = S[:p-2] + 'z'
  print(S)
from scipy.misc import comb
N, K = map(int,input().split())

for i in range(1,K+1):
    c1 = comb(K-1,i-1)
    c2 = comb(N-K+1,i)
    print(int((c1*c2)%(1000000000+7)))



### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
Z = 2000

for i in range( 2, Z + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

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

for i in range(1,K+1):
    c1 = cmb(K-1,i-1,mod)
    c2 = cmb(N-K+1,i,mod)
    print(int((c1*c2)%(1000000000+7)))
n,X,m=map(int,input().split())
x=[0]*m
y=[0]*m
y[0]=X
z=[0]*(m+1)
z[X]+=1
for i in range(1,m):
    x[i]=(i**2)%m
for i in range(1,m+1):
    y[i]=x[y[i-1]]
    z[y[i]]+=1
    if z[y[i]]==2:
        e=i
        q=y[i]
        break
for i in range(len(y)):
    if y[i]==q:
        b=i
        break
l=y[b:e]
L=len(l)
s=sum(l)
#print(x)
#print(y)
#print(z)
#print(b,e)
#print(l)
#print(sum(y[:b]))
#print(((n-b)//L)*s)
#print(sum(l[:(n-b)%L]))
ans=sum(y[:b])+((n-b)//L)*s+sum(l[:(n-b)%L])
if n==1:
    print(X)
else:
    print(ans)

### FIXED CODE ###

n,X,m=map(int,input().split())
if m==1:
    print(0)
else:
    x=[0]*m
    y=[0]*m
    y[0]=X
    z=[0]*(m+1)
    z[X]+=1
    for i in range(1,m):
        x[i]=(i**2)%m
    for i in range(1,m):
        y[i]=x[y[i-1]]
        z[y[i]]+=1
        if z[y[i]]==2:
            e=i
            q=y[i]
            break
    for i in range(len(y)):
        if y[i]==q:
            b=i
            break
    l=y[b:e]
    L=len(l)
    s=sum(l)
    #print(x)
    #print(y)
    #print(z)
    #print(b,e)
    #print(l)
    #print(sum(y[:b]))
    #print(((n-b)//L)*s)
    #print(sum(l[:(n-b)%L]))
    if n>=b:
        ans=sum(y[:b])+((n-b)//L)*s+sum(l[:(n-b)%L])
    else:
        ans=sum(y[:n])
    print(ans)
n,t=map(int,input().split())
m=1001
for i in range(n):c,t=map(int,input().split())
  if i<=t:m=min(m,c)
print("TLE" if m==1001 else m)

### FIXED CODE ###

N,T=map(int,input().split())
m=1001
for i in range(N):
    c,t=map(int,input().split())
    if t<=T:m=min(m,c)
print("TLE" if m==1001 else m)
S = input()
T = input()

len_S = len(S)
len_T = len(T)
for i in range(len_S-len_T, -1, -1):
  if not all(s in ['?', t] for s, t in zip(S[i:i+len_T], T)):
    continue
  print((S[:i] + t + S[i+len_T:]).replace('?','a'))
  exit()
print("UNRESTORABLE")


### FIXED CODE ###

S = input()
T = input()

len_S = len(S)
len_T = len(T)
for i in range(len_S-len_T, -1, -1):
  if not all(s in ['?', t] for s, t in zip(S[i:i+len_T], T)):
    continue
  print((S[:i] + T + S[i+len_T:]).replace('?','a'))
  exit()
print("UNRESTORABLE")
from collections import Counter
N = int(input())

SS = []
for i in range(N):
  s = list(input())
  s.sort()
  SS.append(s)
  
SS.sort()

ans = 0
prev = None
for i in range(N):
  s = S[i]
  if s == prev:
    ans += 1
  prev = s
  
print(ans)
  

### FIXED CODE ###

N = int(input())

SS = []
for i in range(N):
  s = list(input())
  s.sort()
  SS.append(s)
  
SS.sort()

ans = 0
prev = None
cnt = 0
for i in range(N):
  s = SS[i]
  if s == prev:
    if not cnt:
      cnt = 2
    else:
      cnt += 1
  else:
    ans += cnt * (cnt - 1) // 2
    cnt = 0
  prev = s
  
ans += cnt * (cnt - 1) // 2
print(ans)
X,Y = input().split()
if x == y:
  print("=")
elif x > y:
  print(">")
elif x < y:
  print("<")

### FIXED CODE ###

x,y = input().split()
if x == y:
  print("=")
elif x > y:
  print(">")
elif x < y:
  print("<")
X,Y,Z = map(int, input().split())

A = int(Z)
B = int(X)
C = int(Y)

print(f"{A} {B} {C}")


### FIXED CODE ###

X,Y,Z = map(int, input().split(" "))

A = int(Z)
B = int(X)
C = int(Y)

print(str(A) + " " + str(B) + " " + str(C))
a, b, c = input().split()
d = ""
d += a.upper()[0]
d += b.upper()[0] j
d += c.upper()[0]
print(d)

### FIXED CODE ###

a, b, c = input().split()
d = ""
d += a.upper()[0]
d += b.upper()[0] 
d += c.upper()[0]
print(d)
y, m, d = map( int, input().split("/") )
if y < 2019 or ( y == 2019 and m <= 4 )
   print( "Heisei" )
else : 
   print( "TBD" )

### FIXED CODE ###

y, m, d = map( int, input().split("/") )
if y < 2019 or ( y == 2019 and m <= 4 ) :
   print( "Heisei" )
else : 
   print( "TBD" )
import math
s=int(input())
n=len(str(s))
ans=0
if n>=4:
  for i in range(n-3):
    for j in range(i+3,n):
      k=math.floor((s%10**(n-i))/10**(n-j-1))
      if k%2019==0:
        ans+=1
print(ans)

### FIXED CODE ###

s=input()
n=len(s)
a=[0]*2019
a[0]=1
k=0
ans=0
mod=1
for i in range(n-1,-1,-1):
  k=(k+int(s[i])*mod)%2019
  mod=(mod*10)%2019
  a[k]+=1
for i in a:
  ans+=i*(i-1)*0.5

print(int(ans))
print(input().count("1")

### FIXED CODE ###

a, b, c = input()
d = 0
if a == "1":
  d = d + 1
else:
  d = d
if b == "1":
  d = d + 1
else:
  d = d
if c == "1":
  d = d + 1
else:
  d = d
 
print(d)
import numpy as np

N, M= (int(i) for i in input().split())  
lr = [[int(i) for i in input().split()] for i in range(M)] 	
a = np.zeros([M,N])
for i in range(M):
	a[i, lr[i][0]-1:lr[i][1]] = 1
b = list(np.all(a == 1, axis=0))
print(b.count(True))

### FIXED CODE ###

import numpy as np

N, M= (int(i) for i in input().split())  
lr = [[int(i) for i in input().split()] for i in range(M)] 	
lr = np.array(lr)
l = list(lr[:, 0])
r = list(lr[:, 1])
d = min(r)-max(l)+1
if d>0:
	print(d)
else:
	print(0)
A, B, C = list(map(int, input().split()))

print(B if A*N < B else A*N)

### FIXED CODE ###

N, A, B = list(map(int, input().split()))
 
print(B if A*N > B else A*N)
li = [2,3,4,5,6,7,8,9,10,11,12,1]
a,b = map(int,input().split())
if li.index(a) == li.index(b):
    print("Draw")
elif li.index(a) > li.index(b):
    print("Alice")
else:
    print("Bob")

### FIXED CODE ###

li = [2,3,4,5,6,7,8,9,10,11,12,13,1]
a,b = map(int,input().split())
if li.index(a) == li.index(b):
    print("Draw")
elif li.index(a) > li.index(b):
    print("Alice")
else:
    print("Bob")
K, S = map(int,input())
ans = 0
for x in range(K+1):
    for y in range(K+1):
        if 0 <= S - x - y <= K:
            ans += 1
print(ans)


### FIXED CODE ###

K, S = map(int,input().split())
ans = 0
for x in range(K+1):
    for y in range(K+1):
        if 0 <= S - x - y <= K:
            ans += 1
print(ans)
#dp[i][j]:S[i-x:i]==S[j-x:j]となる最大のx
import numpy as np

def solve(N, S, dp):
    for i in range(N - 1):
        for j in range(i + 1, N):
            dp[i][j] = min(j - i, dp[i - 1][j - 1] + 1) if S[i] == S[j] else 0
    return dp.max()

def main():
    N = int(input())
    S = np.array([ord(_) for _ in input()])
    print(solve(I))

def cc_export():
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', '(i8[:],)')(solve)
    cc.compile()
#dp[i][j]:S[i-x:i]==S[j-x:j]となる最大のx
import numpy as np

def solve(NS):
    N = NS[0]
    S = NS[1:]
    for i in range(N - 1):
        for j in range(i + 1, N):
            dp[i][j] = min(j - i, dp[i - 1][j - 1] + 1) if S[i] == S[j] else 0
    return dp.max()

def main():
    NS = np.array([int(input())] + [ord(_) for _ in input()])
    print(solve(NS))

def cc_export():
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', '(i8[:],)')(solve)
    cc.compile()

if __name__ == '__main__':
    import sys
    if sys.argv[-1] == 'ONLINE_JUDGE':
        cc_export()
        exit(0)
    from my_module import solve
    main()


### FIXED CODE ###

import itertools
N = int(input())
S = input()
dp = [[0] * N for _ in range(N)]
ans = 0
for i, j in itertools.combinations(range(N), 2):
    if S[i] == S[j]:
        dp[i][j] = dp[i - 1][j - 1] + 1
    else:
        dp[i][j] = 0
    ans = max(ans, min(j - i, dp[i][j]))
print(ans)
from sys import stdin,stdout
for _ in range(1):#int(stdin.readline())):
    # n=int(stdin.readline())
    x,k,d=list(map(int,stdin.readline().split()))
    if x==k==d:
        print(0 if k&1 else x)
        continue
    des=x%d
    op=x//d
    a=[des,des-d]
    if k<=op:#check for eq
        print(x-k*d)
    else:
        print(abs(a[k%op]))

### FIXED CODE ###

from sys import stdin,stdout
for _ in range(1):#int(stdin.readline())):
    # n=int(stdin.readline())
    x,k,d=list(map(int,stdin.readline().split()))
    '''if x==k==d:
        print(0 if k&1 else x)
        continue'''
    x=abs(x)
    des=x%d
    op=x//d
    # print(des,op)
    a=[des,des-d]
    if k<op:#check for eq
        print(x-k*d)
    else:
        print(abs(a[(k-op)%2]))
a = [int(i) for i in a.split()]
# N:参加回数　R:表示レーティング
N = a[0]
R = a[1]

# X:内部レーティング
#R = X - 100 * (10 - N)
if N >= 10:
    print(R)
else:
    print(R + 100 * (10 - N))

### FIXED CODE ###

a = [int(i) for i in input().split()]
# N:参加回数　R:表示レーティング
N = a[0]
R = a[1]

# X:内部レーティング
#R = X - 100 * (10 - N)
if N >= 10:
    print(R)
else:
    print(R + 100 * (10 - N))
N = int(input())
Ga, Sa, Ba = map(int, input().split())
Gb, Sb, Bb = map(int, input().split())
M = max(Ga, Sa, Ba)

dp = [0]*(M+1)
for i in range(M+1, N+M+1):
  dp.append(max(
    dp[-1] + 1,
    dp[-Ga] + Gb,
    dp[-Sa] + Sb,
    dp[-Ba] + Bb,
  ))
N2 = dp[-1]

dp = [0]*(M+1)
for i in range(M+1, N2+M+1):
  dp.append(max(
    dp[-1] + 1,
    dp[-Gb] + Ga,
    dp[-Sb] + Sa,
    dp[-Bb] + Ba,
  ))
print(dp[-1])

### FIXED CODE ###

N = int(input())
Ga, Sa, Ba = map(int, input().split())
Gb, Sb, Bb = map(int, input().split())

dp = [0]
for i in range(1, N+1):
  tmp = dp[-1] + 1
  if Ga <= i:
    t2 = dp[-Ga] + Gb
    tmp = tmp if tmp > t2 else t2
  if Sa <= i:
    t2 = dp[-Sa] + Sb
    tmp = tmp if tmp > t2 else t2
  if Ba <= i:
    t2 = dp[-Ba] + Bb
    tmp = tmp if tmp > t2 else t2
  dp.append(tmp)
N2 = dp[-1]

dp = [0]
for i in range(1, N2+1):
  tmp = dp[-1] + 1
  if Gb <= i:
    t2 = dp[-Gb] + Ga
    tmp = tmp if tmp > t2 else t2
  if Sb <= i:
    t2 = dp[-Sb] + Sa
    tmp = tmp if tmp > t2 else t2
  if Bb <= i:
    t2 = dp[-Bb] + Ba
    tmp = tmp if tmp > t2 else t2
  dp.append(tmp)
print(dp[-1])
N = int(input())
a = [int(input()) for i in range(N)]
ch = [0] * (10**5 + 1)
if a[0] == 1 or a[1]  == 2:
    print(-1)
ch[1] = numB
c = 1
while True:
    numB = a[numB-1]
    if numB == 2:
        print(c)
        break
    if ch[numB] == 1:
        print(-1)
        break
    c += 1
    ch[numB] = 1


### FIXED CODE ###

N = int(input())
a = [int(input()) for i in range(N)]
ch = [0] * (10**5 + 1)
numB = 1
ch[1] = numB
c = 1
while True:
    numB = a[numB-1]
    if numB == 2:
        print(c)
        break
    if ch[numB] == 1:
        print(-1)
        break
    c += 1
    ch[numB] = 1
h,w=map(int,input().split())
lst=list(input() for i in range(h))
for a in lst:
    if a=="."*w:
        h-=1
        lst.remove(a)
lst=list(map(list,lst))
for i in range(w):
    T=True
    if i>w:
        break
    for b in range(h):
        if lst[b][i]!="." :
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(i)
        w-=1
for b in range(h):
    print("".join(lst[b]))

### FIXED CODE ###

h,w=map(int,input().split())
lst=list(input() for i in range(h))
n_h=h
for i in range(len(lst)):
    if "#" not in lst[h-i-1]:
        n_h-=1
        lst.pop(h-i-1)
h=n_h
n_w=w
lst=list(map(list,lst))
for i in range(w):
    T=True
    for b in range(h):
        if lst[b][w-i-1]=="#":
            T=False
            break
    if T:
        for b in range(h):
            lst[b].pop(w-i-1)
            n_w-=1
for b in range(h):
    print("".join(lst[b]))
from fractions import gcd

n,k = map(int, input().split())
a = list(map(int, input().split())
         
m = max(a)
         
g = a[0]
         
for i in range(n):
    g = gcd(g, a[i])

if k>m:
    print("IMPOSSIBLE")
elif k % g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


### FIXED CODE ###

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


n, k = map(int, input().split())
a = list(map(int, input().split()))

m = max(a)

g = a[0]

for i in range(n):
    g = gcd(g, a[i])

if k > m:
    print("IMPOSSIBLE")
elif k % g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
import math
def add(n):
    return n + 1

def lcm(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = ans * a[i] // math.gcd(ans, a[i])
    return ans

if __name__ == "__main__":

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

    indexes = [i for i, x in enumerate(a) if x == 1]
    indexes = list(map(add, indexes))
    
    boxes = []
    if indexes:
        num = lcm(indexes)
        if max(indexes) > n:
            print("-1")
        else:
            while num > n:
                boxes.append(indexes.pop())
                num = lcm(indexes)
            print("{}".format(len(boxes)+1))
            if boxes:
                boxes = ' '.join(map(str,boxes)) + " " + str(num)
            else:
                boxes = str(num)
            print(boxes)
    else:
        print("0")

### FIXED CODE ###

def add(n):
    return n + 1

if __name__ == "__main__":
    n = int(input())
    buf = input().split()
    a = [int(s) for s in buf]
    
    boxes = [0] * n

    for i in reversed(range(n)):
        pick_boxes = boxes[i::i+1]
        pick_boxes.pop(0)
        if pick_boxes:
            if (sum(pick_boxes) % 2) == a[i]:
                boxes[i] = 0
            else:
                boxes[i] = 1
        else:
            boxes[i] = a[i]

    box_name = [i for i, x in enumerate(boxes) if x == 1]
    box_name = list(map(add, box_name))
    print(len(box_name))
    if len(box_name) != 0:
        box_name = ' '.join(map(str,box_name))
        print(box_name)
N = int(input())
p = list(map(int, input().split()))
P = list(range(1,N+1))
tmp = [P[i]-p[i] for i in range(N)]
tmp = set(tmp)
tmp.discard(0)
if not tmp:
    print('YES')
elif len(tmp) == 2 and abs(tmp[0]) == abs(tmp[1]):
    print('YES')
else:
    print('NO')

### FIXED CODE ###

N = int(input())
p = list(map(int, input().split()))
P = list(range(1,N+1))
if p == P:
    print('YES')
    exit()

tmp = [i for i in range(N) if P[i] - p[i] != 0]
#print(tmp)

if len(tmp) != 2:
    print('NO')
else:
    p[tmp[0]], p[tmp[1]] = p[tmp[1]], p[tmp[0]]
    if p == P:
        print('YES')
    else:
        print('NO')
sys.setrecursionlimit(10**9)
N = int(input())
h = list(map(int, input().split()))
memo = [-1]*N
def dp(i):
    if memo[i]>=0:
        return memo[i]
    if i == 0:
        memo[i] = 0
        return 0
    if i>=2:
        memo[i] = min(dp(i-1)+abs(h[i]-h[i-1]), dp(i-2)+abs(h[i]-h[i-2]))
    else:
        memo[i] = dp(i-1)+abs(h[i]-h[i-1])
    return memo[i]
print(dp(N-1))



### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
dp = [0]*N
for i in range(1, N):
    if i-2>=0:
        dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))
    else:
        dp[i] = dp[i-1]+abs(h[i]-h[i-1])
print(dp[-1])
s=int(input())
if s[0]!=s[1] and s[1]!=s[2] and s[2]!=s[3]:
  print('Good')
  
else:
  print('Bad')
  

### FIXED CODE ###

s=input()
if s[0]!=s[1] and s[1]!=s[2] and s[2]!=s[3]:
  print('Good')
  
else:
  print('Bad')
inp = list(map(int,input().split()))
 
a = inp[0]*inp[1]

if (inp[0]==1 or inp[1]==1):
    print("1")
else:
    if (a %2 == 1):
        b = int(a/2)+1
    else:
        b = a/2
 
print(b)


### FIXED CODE ###

inp = list(map(int,input().split()))
 
a = inp[0]*inp[1]

if (inp[0]==1 or inp[1]==1):
    print("1")
else:
    if (a %2 == 1):
        b = int(a/2)+1
        print('{:.19g}'.format(b))
    else:
        b = a/2
        print('{:.19g}'.format(b))