Harryxun/stf_run huggingface dataset:
h,w,kk=list(map(int,input().split()))
s=[list(map(int,list(input()))) for i in range(h)]
l=[]
for i in range(2**(h-1)):
  ll=[0]
  for j in range(h-1):
    if i & 2**j:
      ll.append(ll[-1]+1)
    else:
      ll.append(ll[-1])
  l.append(ll)

mc=w+h
for i in l:
  c=[0 for i in range(h)]
  cc=0
  f=1
  #print(i,0)
  for j in range(w):
    #print(c)
    ff=0
    for k in range(h):
      c[i[k]]+=s[k][j]
    for k in range(h):
      if c[k]>kk:
        ff=1
        break
    if ff:
      if f:
        cc=w+h
        print(c)
        break
      cc+=1
      c=[0 for i in range(h)]
      for k in range(h):
        c[i[k]]+=s[k][j]
    f=0
  #print(cc)
  if mc>cc+len(set(i)-1):
    mc=cc
print(mc)
        

### FIXED CODE ###

h,w,kk=list(map(int,input().split()))
s=[list(map(int,list(input()))) for i in range(h)]
l=[]
for i in range(2**(h-1)):
  ll=[0]
  for j in range(h-1):
    if i & 2**j:
      ll.append(ll[-1]+1)
    else:
      ll.append(ll[-1])
  l.append(ll)

mc=w+h
for i in l:
  c=[0 for i in range(h)]
  cc=0
  f=1
  #print(i,0)
  for j in range(w):
    #print(c)
    ff=0
    for k in range(h):
      c[i[k]]+=s[k][j]
    for k in range(h):
      if c[k]>kk:
        ff=1
        break
    if ff:
      cc+=1
      c=[0 for i in range(h)]
      for k in range(h):
        c[i[k]]+=s[k][j]
      for k in range(h):
        if c[k]>kk:
          f=1
      if f:
        cc=w+h
        #print(c)
        break
    f=0
  #print(cc)
  if mc>cc+len(set(i))-1:
    mc=cc+len(set(i))-1
print(mc)
n, k = map(int, input().split())
 
member = [0]*n
 
for i in range(k):
    d = int(input())
   
    for j in range(d):
        a = [int(x) for x in input().split()]
        member[a[j]-1] += 1
 
print(member.count(0))

### FIXED CODE ###

n, k = map(int, input().split())
 
m = [0]*n
 
for i in range(k):
    d = int(input())
    a = [int(x) for x in input().split()]
    for j in range(d):
        m[a[j]-1] += 1
 
print(m.count(0))
print(input()**3)



### FIXED CODE ###

# python3 では input()は文字列として処理される。

x = int(input())
print(x**3)
N, M = (int(i) for i in input().split())
ans = 1

# N = 100000                                                                                                                                                                                                                                                                          
# M = 100000                                                                                                                                                                                                                                                                          

if __name__ == '__main__':
    if N == (M + 1) or N == (M - 1):
        for n in range(1, N+1):
            ans *= n
            ans %= 1e9 + 7
        for m in range(1, M+1):
            ans *= m
            ans %= 1e9 + 7
    elif N == M:
        for n in range(1, N+1):
            ans *= n
            ans %= 1e9 + 7
        for m in range(1, M+1):
            ans *= m
            ans %= 1e9 + 7
        ans *= 2
        ans %= 1e9 + 7
    else:
        ans = 0

    print int(ans)

### FIXED CODE ###

import sys

N, M = (int(i) for i in raw_input().split())
ans = 1                                                                                                                                                                                                                                                                     

if __name__ == '__main__':
    if N == (M + 1) or N == (M - 1):
        for n in range(1, N+1):
            ans *= n
            ans %= 1e9 + 7
        for m in range(1, M+1):
            ans *= m
            ans %= 1e9 + 7
    elif N == M:
        for n in range(1, N+1):
            ans *= n
            ans %= 1e9 + 7
        for m in range(1, M+1):
            ans *= m
            ans %= 1e9 + 7
        ans *= 2
        ans %= 1e9 + 7
    else:
        ans = 0

    print int(ans)
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(lambda x: int(x) - 1, input().split()))
loop = []
start = 0
index = 0
check = [-1] * N
fin = False
count = 0
while True:
    if check[index] != -1:
        start = check[index]
        break
    else:
        loop.append(index)
        if len(loop) == K + 1:
            print(index + 1)
			exit()
        check[index] = count
        count += 1
        index = a[index]


if (K + 1 - start) % len(loop[start:]) == 0:
    print(loop[-1] + 1)
else:
    print(loop[start + (K + 1 - start) % len(loop[start:]) - 1] + 1)


### FIXED CODE ###

import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(lambda x: int(x) - 1, input().split()))
loop = []
start = 0
index = 0
check = [-1] * N
fin = False
count = 0
while True:
    if check[index] != -1:
        start = check[index]
        break
    else:
        loop.append(index)
        if len(loop) == K + 1:
            print(index + 1)
            fin = True
            break
        check[index] = count
        count += 1
        index = a[index]

if not fin:  # len(loop)<=K
    if (K + 1 - start) % len(loop[start:]) == 0:
        print(loop[-1] + 1)
    else:
        print(loop[start + (K + 1 - start) % len(loop[start:]) - 1] + 1)
import numpy as np

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

if n[1] > n[2]:
    for c in range(n[0):
            print('Yes')
else:
    a = []

    for i in range(n[2]):
        a.append(int(input()))

    m = [n[1]]*n[0]

    x = np.array(m)
    for j in range(n[2]):
        x -= 1
        x[a[j]-1] += 1

    for num in range(n[0]):
        if x[num] <= 0:
            print('No')
        else:
            print('Yes')



### FIXED CODE ###

import numpy as np

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

a = []

for i in range(n[2]):
    a.append(int(input()))

if n[1] > n[2]:
    for c in range(n[0]):
            print('Yes')

else:
    m = [n[1]]*n[0]

    x = np.array(m)
    x -= n[2]
    for j in range(n[2]):
        x[a[j]-1] += 1

    for num in range(n[0]):
        if x[num] <= 0:
            print('No')
        else:
            print('Yes')
X = int(input())
Y = int(input())
Z = int(input())
X, Y, Z = Z, X, Y
print(X, Y, Z)

### FIXED CODE ###

X, Y, Z = list(map(int, input().split()))
X, Y, Z = Z, X, Y
print(X, Y, Z)
n,m = map(int, input().split())
sc = [map(int, input().split()) for _ in range(m)]
s, c = [list(i) for i in zip(*sc)]



for i in range(10**n):
    ans = str(i)
    if len(i) == n and all([i[s[j]-1] == str(c[j]) for j in range(m)]):
        print(ans)
        exit()


print(-1)

### FIXED CODE ###

# n,m = map(int, input().split())
# sc = [map(int, input().split()) for _ in range(m)]
# s, c = [list(i) for i in zip(*sc)]
#
#
#
# for i in range(10**n):
#     ans = str(i)
#     if len(i) == n and all([i[s[j]-1] == str(c[j]) for j in range(m)]):
#         print(ans)
#         exit()
#
#
# print(-1)

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

s, c = [], []
for _ in range(m):
    s_, c_ = map(int, input().split())
    s.append(s_)
    c.append(c_)

for i in range(10 ** n):
    ans = str(i)
    if len(ans) == n and all([ans[s[j] - 1] == str(c[j]) for j in range(m)]):
        print(ans)
        exit()

print(-1)
s = input()
k = int(input())
ans = "1"
for i in range(100):
    if s[i] != "1":
        ans = s[i]
        break

print(ans)

### FIXED CODE ###

s = input()
k = int(input())
ans = "1"
n1 = 100
for i in range(len(s)):
    if s[i] != "1":
        ans = s[i]
        n1 = i
        break
if k-1 >= n1:
    print(ans)
else:
    print("1")
# -*- coding: utf-8 -*-

import math

n = int(raw_input())

i = 1
sqn = math.ceil(math.sqrt(n))

while math.sqrt(n) > i:
    if n % i == 0:
        ans = int(math.log10(n / i)) + 1
    i += 1
print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-

import math

n = int(raw_input())

i = 1
# sqn = math.ceil(math.sqrt(n))

while i * i <= n:
    if n % i == 0:
        ans = n / i
        #ans = int(math.log10(n / i)) + 1
    i += 1
print len(str(ans))#(ans)
a = int(input())
if a == 'ABC':
    print('ARC')
else:
    print('ABC')

### FIXED CODE ###

a = input()
if a == 'ABC':
    print('ARC')
else:
    print('ABC')
N = int(input())
T,A = map(int,input().split(" "))
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
 
m = float("inf")
arg = 0
for i in range(N):
  if H_[i] < m:
    arg = i+1
    m = H[i]
 
print(arg)

### FIXED CODE ###

N = int(input())
T,A = map(int,input().split(" "))
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
     
m = float("inf")
arg = 0
for i in range(N):
  if H_[i] < m:
    arg = i+1
    m = H_[i]
     
print(arg)
a=int(input())
for x in range(int(a**0.5),0,-1):
	if a%x==0:
    d=a//x
    s=d+x-2
    break
print(s)

### FIXED CODE ###

a=int(input())
for x in range(int(a**0.5),0,-1):
  if a%x==0:
    b=int(a//x)
    break
print(b+x-2)
def divisors(n):
  small = []
  large = []
  i = 1
  while i * i <= n:
    if not n % i:
      small.append(i)
      large.append(n // i)
    i += 1
  if small[-1] == large[-1]:
    large.pop()
  return small + large[::-1]

n = int(input())
res = set(divisors(n - 1))
res.remove(1)

for d in divisor(n):
  if d == 1:
    continue
  now = n
  # simulation
  while not now % d:
    now //= now
  if now % d == 1:
    res.add(d)

print(len(res))

### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7 # 998244353
input=lambda:sys.stdin.readline().rstrip()
def divisors(n):
    S,T=[],[]
    for i in range(1,int(n**.5)+1):
        if(n%i==0):
            S.append(i)
            T.append(n//i)
    T.reverse()
    return S+T if(S[-1]!=T[0]) else S+T[1:]

def resolve():
    n = int(input())
    res = set(divisors(n-1))
    res.remove(1)
    res.add(n)

    for s in divisors(n):
        if s == n:
            continue
        tmp = s
        t = n // s
        if s < t: # s >= t
            continue
        while s % t == 0:
            s //= t
        s %= t
        if s == 1:
            res.add(tmp)

    print(len(res))
resolve()
s = input()
import re
if "keyence" == s:
    print("YES")
    exit()

if re.fullmatch(".*keyence",s) is not None:
    print("YES")
    exit()

if re.fullmatch("k.*eyence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("ke.*yence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("key.*ence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keye.*nce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyen.*ce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyenc.*e",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyence.*",s) is not None:
    print("YES")
    exit()
print("NO")

### FIXED CODE ###

s = input()
import re
if "keyence" == s:
    print("YES")
    exit()

if re.fullmatch(".*keyence",s) is not None:
    print("YES")
    exit()

if re.fullmatch("k.*eyence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("ke.*yence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("key.*ence",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keye.*nce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyen.*ce",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyenc.*e",s) is not None:
    print("YES")
    exit()
if re.fullmatch("keyence.*",s) is not None:
    print("YES")
    exit()
print("NO")
import sys

lineNumber = 0
#for line in [ "xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt." ]:
for line in sys.stdin.readlines():
    lineNumber += 1

    # get data
    List = map(int, line.strip().split(","))

    List = List.sort().reverse()

    print "%d %d %d %d %d" % (List[0], List[1], List[2], List[3], List[4])

### FIXED CODE ###



import sys

lineNumber = 0

#for line in ["3 6 9 7 5"]:
for line in sys.stdin.readlines():
    lineNumber += 1

    # get data
    List = map(int, line.strip().split(" "))

    List.sort()

    print "%d %d %d %d %d" % (List[4], List[3], List[2], List[1], List[0])
*A,=map(int,open(0));i=1;t=[0]*A[0]
while i-2or i in t:t[i]=1;i=A[i]
print(-1if i-2else sum(t))

### FIXED CODE ###

*A,=map(int,open(0));i=1;t=[0]*A[0]+[0]
while i-2and t[i]==0:t[i]=1;i=A[i]
print(-1if i-2else sum(t))
from math import ceil
T = int(input())
for i in range(T):
    N,A,B,C,D = map(int,input().split())
    memo = {0:0,1:D}
    def f(n):
        if n in memo:
            return memo[n]
        else:
            res = D*n
            r2 = n%2
            r3 = n%3
            r5 = n%5
            res = min(res,f(n//2)+A+r2*D,f(n//3)+B+r3*D,f(n//5)+C+r5*D)
            res = min(res,f(n//2+1)+A+(2+r2)*D,f(n//3+1)+B+(3+r3)*D,f(n//5+1)+C+(5+r5)*D)
            res = min(res,f(ceil(n/2))+A+(2-r2)*D,f(ceil(n/3))+B+(3-r3)*D,f(ceil(n/5))+C+(5-r5)*D)
            memo[n] = res
            return res
    print(f(N))

### FIXED CODE ###

T = int(input())
for i in range(T):
    N,A,B,C,D = map(int,input().split())
    memo = {0:0,1:D}
    def f(n):
        if n in memo:
            return memo[n]
        else:
            res = D*n
            r2 = n%2
            r3 = n%3
            r5 = n%5
            res = min(res,f(n//2)+A+r2*D,f(n//3)+B+r3*D,f(n//5)+C+r5*D)
            res = min(res,f((n+1)//2)+A+(2-r2)*D,f((n+2)//3)+B+(3-r3)*D,f((n+4)//5)+C+(5-r5)*D)
            memo[n] = res
            return res
    print(f(N))
_input = [i for i in open(0).read().split('\n') if i]
n, k = [int(i) for i in _input[0].split()]
edge = [[int(p) for p in i.split()] for i in _input[1:n]]

import collections

colored  = {}
edge_map = collections.defaultdict(list)
for e in edge:
    edge_map[e[0]].append(e[1])
    edge_map[e[1]].append(e[0])

root = edge[0][0]
colored[root] = k
for i, p in enumerate(edge_map[root]):
    colored[p] = k - (i + 1)

visit = []
visit.extend(edge_map[root])
while visit:
    current = visit.pop(0)
    not_colored = [p for p in edge_map[current] if p not in colored]
    visit = not_colored + visit
    for i, p in enumerate(not_colored):
        colored[p] = k - (i + 2)

print(colored)
total = 1
for i in colored.values():
    total *= i
    if total > 1000000007:
        total %= 1000000007
print(total)


### FIXED CODE ###

import sys
sys.setrecursionlimit(4100000)

_input = [i for i in open(0).read().split('\n') if i]
n, k = [int(i) for i in _input[0].split()]
edge = tuple([tuple([int(p) for p in i.split()]) for i in _input[1:n]])

factorial = [0] * (k + 1)
inverse = [0] * (k + 1)
MOD = 1000000007

# Ref: http://keita-matsushita.hatenablog.com/entry/2016/12/05/175024
def mod_pow1(n, k, mod):
    a = 1
    while k:
        if (k & 1) == 1:
            a = (a * n) % mod
        n = (n * n) % mod
        k >>= 1
    return a

# Ref: https://www.smartbowwow.com/2018/10/mod1097.html
def mod_pow2(n, k, mod):
    if k == 0:
        return 1
    if k % 2 == 0:
        a = mod_pow2(n, k // 2, mod)
        return (a * a) % mod
    else:
        return (n * mod_pow2(n, k - 1, mod)) % mod

#mod_pow = mod_pow1
# It's better to use built-in function for speed.
mod_pow = pow

def mod_factorial_inverse(k, mod):
    factorial[0] = 1
    inverse[0] = 1

    # Ref: http://keita-matsushita.hatenablog.com/entry/2016/12/05/184011
    for i in range(1, k + 1):
        factorial[i] = ((i * factorial[i - 1]) % mod) # factrial[i]
        inverse[i] = mod_pow(factorial[i], mod - 2, mod) # inverse[i]
 
total = 1

if not edge:
    print(k)
else:
    all_edge = tuple([[] for _ in range(n + 1)])
    for e in edge:
        all_edge[e[0]].append(e[1])
        all_edge[e[1]].append(e[0])
    all_edge = [set(v) for v in all_edge]

    if [v for v in all_edge if len(v) >= k]:
        print(0)
    else:
        mod_factorial_inverse(k, MOD)

        root = edge[0]
        total = (factorial[k] * inverse[k - len(all_edge[root[0]]) - 1]) % MOD

        def dfs(current, from_):
            global total
            child = all_edge[current]
            if len(child) - 1 > 0:
                total = (total * factorial[k - 2] * inverse[k - 2 - (len(child) - 1)]) % MOD
            for c in child:
                if c != from_:
                    dfs(c, current)
        for c in all_edge[root[0]]:
            dfs(c, root[0])
        print(total)
a = input()

b = a[len(a)-1]

if b=='3':
	print('bon')
else if b == '0' or  b == '1' or  b == '6' or b == '8':
	print('pon')
else:
	print('hon')
	

### FIXED CODE ###

a = input()
 
b = a[len(a)-1]
 
if b=='3':
	print('bon')
elif b == '0' or  b == '1' or  b == '6' or b == '8':
	print('pon')
else:
	print('hon')
B1=K-A[N-1]+A[0]

B=[]
i=0
while i<=N-2:
    B.append(A[i+1]-A[i])
    i=i+1
B=sorted(B)
print(K-max(B1,B[-1]))

### FIXED CODE ###

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

B1=K-A[N-1]+A[0]

B=[]
i=0
while i<=N-2:
    B.append(A[i+1]-A[i])
    i=i+1
B=sorted(B)
print(K-max(B1,B[-1]))
N = int(input())
h = list(map(int,input().split()))
dp = [-1]*N

for i in range(N):
    dp[i] = rec_dp(i,dp)

def rec_dp(i,dp):
    if i==0:
        return 0
    elif i==1:
        return abs(h[1]-h[0])
    else:
        onestepmin = dp[i-1] + abs(h[i-1] - h[i])
        twostepmin = dp[i-2] + abs(h[i-2] - h[i])
        return min(onestepmin,twostepmin)


print(dp[N-1])

### FIXED CODE ###

N = int(input())
h = list(map(int,input().split()))
dp = [-1]*N

def rec_dp(i,dp):
    if i==0:
        return 0
    elif i==1:
        return abs(h[1]-h[0])
    else:
        onestepmin = dp[i-1] + abs(h[i-1] - h[i])
        twostepmin = dp[i-2] + abs(h[i-2] - h[i])
        return min([onestepmin,twostepmin])

for i in range(N):
    dp[i] = rec_dp(i,dp)

print(dp[N-1])
a=int(input())
ans = 0
while i <= a+1
if a%3 != 0 and a%5 !=0:
  ans += i
print(ans)
  
  

### FIXED CODE ###

n=int(input())
ans = 0
for i in range(n+1):
	if i%3 != 0 and i%5 !=0:
  		ans += i
print(ans)
n,X = map(int,input().split())
x =list(map(int,input().split()))
x.append(X)
x.sort()
a = []
for i in range(n):
  a.append(x[i+1]-x[i])
  
g = []
h = min(a)
gcd = 1
for i in range(h,0,-1):
  if h%i == 0:
    if all(a[j]%i == 0 for j in range(n)):
      gcd = i
      break
      
print(gcd)
    

    
    
    


    gcd = i
    break
    
    
print(gcd)
    
  
  




### FIXED CODE ###

n,X = map(int,input().split())
x =list(map(int,input().split()))
x.append(X)
x.sort()
a = []
for i in range(n):
  a.append(x[i+1]-x[i])
  
h = min(a)
gcd = 1
for i in range(h,0,-1):
  if h%i == 0:
    if all(a[j]%i == 0 for j in range(n)):
      gcd = i
      break
      
print(gcd)
a, b = map(int, input().split())
c = 2019

for i in range(a, b):
  for j in range(a + 1 , b + 1):
    c = min(c, i * j % 2019)
    if c == 0:
    	print(c)
        exit()
print(c)


### FIXED CODE ###

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

if b - a >= 2019:
    print(0)
else:
    for i in range(a, b):
        for j in range(a + 1 , b + 1):
            c = min(c, i * j % 2019)
    print(c)
import sympy
n=int(input())
li=[]
f=[sympy.divitor_count(i) for i in range(1,n+1)]
for i in range(1,n+1):
    li.append(i*f[i])
print(sum(li))


### FIXED CODE ###

n=int(input())

#L=[n//i*(i+n//i*i)//2 for i in range(1,n+1)]
#print(sum(L))
ans=0
#for i in range(1,n+1):
#    for j in range(1,n+1):
#        if i%j==0:
#            ans+=i
#print(ans)
g=lambda x:(x*(n//x)*(n//x+1))//2
print(sum(g(i) for i in range(1,n+1)))
n=int(input())
v=list(map(int, input().split()))

v.sort()
print(v)
#subtotal=(v[0]+v[1])/2

for i in range(n-2):
    subtotal = (subtotal+v[i+2])/2
print(subtotal)
    

### FIXED CODE ###

n=int(input())
v=list(map(int, input().split()))

v.sort()
#print(v)
subtotal=(v[0]+v[1])/2

for i in range(n-2):
    subtotal = (subtotal+v[i+2])/2
print(subtotal)
a, b = input().split(" ")
a = int(a)
b = int(b)
if a-2b < 0:
  print(0)
else:
  print(a-2b)

### FIXED CODE ###

a, b = input().split(" ")
a = int(a)
b = int(b)
if a-2*b < 0:
  print(0)
else:
  print(a-2*b)
import math

n = int(input())
nums = [int(input()) for i in range(n)]

minNum = nums[0]
maxDiff = -math.inf
for i in nums[1:]:
    diff = i - minNum
    if diff > maxDiff:
        maxDiff = diff
    if minNum > i:
        minNum = i

print(maxDiff)

### FIXED CODE ###

n = int(input())
nums = [int(input()) for i in range(n)]

minNum = nums[0]
maxDiff = False
for i in nums[1:]:
    diff = i - minNum
    if maxDiff == False or diff > maxDiff:
        maxDiff = diff
    if minNum > i:
        minNum = i

print(maxDiff)
# PrimeNumber

from itertools import product
import math

if __name__ == "__main__":
    while True:
        try:
            n = int(input())
            nlist = []
            nlist2 = []
            plist = []

            for i in range(2, n + 1):
                nlist.append(i)  # [2,3,4,5,6,...,n]

            while True:
                #print(nlist, " ", math.sqrt(n))
                if nlist[0] > math.sqrt(n):  # 終了条件
                    #plist.append(map(int,nlist))
                    plist.extend(nlist)
                    break;
                else:
                    plist.append(nlist[0])

                    #i = 0
                    for j in nlist:
                        if j % nlist[0] != 0:
                            #nlist.pop(i)
                            #nlist.remove(j)
                            nlist2.append(j)
                        #i += 1
                    nlist = nlist2
                    nlist2 = []
            #print("fin: {}".format(plist))
            print(len(plist))

        except EOFError:
            break  # escape from while loop

pass
#

### FIXED CODE ###

if __name__ == "__main__":
	maxn = 1000000
	plist = [False if i%2==0 or i%3==0 or i%5==0 else True for i in range(maxn)]

	plist[0] = plist[1] = False
	plist[2] = plist[3] = plist[5] = True

	for chki in range(3, maxn, 2):
		for j in range(chki**2, maxn, chki):
			plist[j] = False

	while True:
		try:
			#start = time.time()
			inn = int(raw_input())
			print plist[0:inn+1].count(True)
			#print plist
			#print plist.count(True)
			#print plist[0:10].count(True)
			#print plist[0:100000].count(True)
			#print plist[0:1000000].count(True)

			#elapsedTime = time.time() -start
			#print elapsedTime
		except:
			break
t=input()

def score(t):
  count=0
  for i in range(len(t)-1):
    if t[i]=='D':
      count+=1
    if t[i]=='P'and t[i+1]=='D':
      count+=1
  return count

hold=0
for i in range(t.count('?')):
  t_tr=t.replace('?','D',i+1)
  t_tr=t_tr.replace('?','P')
  if hold<=score(t_tr):
    hold=score(t_tr)
    t_hold=t_tr

print(t_hold)

### FIXED CODE ###

t=input()

def score(t):
  count=0
  for i in range(len(t)-1):
    if t[i]=='D':
      count+=1
    if t[i]=='P'and t[i+1]=='D':
      count+=1
  return count

hold=0

t_tr=t.replace('?','D')
#if hold<=score(t_tr):
#  hold=score(t_tr)
#  t_hold=t_tr

print(t_tr)
a, b, k = map(int, input().split())
if a + k >= b:
  a_k = b
else:
  a_k = a + k

if b - k <= 0:
  b_k = a
else:
  b_k = b - k


result = sort(list(set([i for i in range(a, a_k + 1)] + [i for i in range(b_k, b + 1)])))
for n in result:
  print(n)

### FIXED CODE ###

a, b, k = map(int, input().split())
if a + k > b:
  a_k = b
else:
  a_k = a + k

if b - k < a:
  b_k = a
else:
  b_k = b - k
  
if a == b:
  a_k = a + 1
  b_k = b + 1

result = list(set([i for i in range(a, a_k)] + [i for i in range(b_k + 1, b + 1)]))
result.sort()
for n in result:
  print(n)
S = input('天気が雨である日が連続していた最大の日数を出力せよ。')
N = True
while N == False:
if S == 'SSS':
	print(0)
else if S == 'SSR':
	print(1)
else if S == 'SRR':
	print(2)
else if S == 'SRS':
	print(1)
else if S == 'RSS':
	print(1)
else if S == 'RRS':
	print(2)
else if S == 'RRR':
	print(3)
else if S == 'RSR':
	print(1)
else:
	N = False
  

### FIXED CODE ###

S = input()
if S == 'SSS':
  print(0)
elif S == 'SRR':
  print(2)
elif S == 'RRS':
  print(2)
elif S == 'RRR':
  print(3)
else:
  print(1)
N,K=map(int,input.split())
TMP=K
ANS=1
if N <= K:
  ANS=1
else:
  TMP+=(K-1)
  ANS+=1
  if N <= K:
    break
print(ANS)


### FIXED CODE ###

N,K=map(int,input().split())
TMP=K
ANS=1
if N <= K:
  ANS=1
else:
  while True:
    TMP+=(K-1)
    ANS+=1
    if N <= TMP:
      break
print(ANS)
x=int(input)
m=100
cnt=0
while x>m:
    cnt+=1
    m=(m*1.01)//1
print(str(cnt))


### FIXED CODE ###

x=int(input())
m=100
cnt=0
while x>m:
    cnt+=1
    m=(m*1.01)//1
print(str(cnt))
import math
a=int(input())
b=math.floor(float(a/2))
print({}.format(float((a-b)/a)))


### FIXED CODE ###

import math
a=int(input())
b=math.floor(float(a/2))
print(float((a-b)/a))