Problem:


問題 A  KUPC

問題文

とある学生が，Kyoto University Programming Contest (KUPC) を開こうと考えた．そこで彼は，看板を作って皆に宣伝することにした．今，手元にはアルファベット 1 文字の書かれた板がいくつもある．これらの板から 'K'，'U'，'P'，'C' という文字の書かれた 4 枚の板を選ぶことで看板を 1 つ作成できる．この作業を繰り返すことで，沢山の看板を作成できるはずである．さて，与えられた板を使って，最終的に何枚の KUPC と書かれた看板が得られるだろうか？

入力形式

文字列が 1 行で与えられる．文字列の各文字は，各板に書かれている文字を表す．

出力形式

KUPC という看板が何枚作成できるかを計算し，その数を 1 行に出力せよ．

制約

文字列はアルファベットのみからなる．

文字列の長さは 300 以内である．

入出力例

入力例 1

KUPCkupcKUPC

出力例1

2

入力例 2

UNPACK

出力例 2

1

入力例 3

KkKUUuPPPCCC

出力例 3

2


Sample input:
KUPCkupcKUPC


Sample output:
2

Submission status: Accepted

Solution code:
from collections import Counter
d = Counter(list("KUPC" + input()))
print(min(d["K"], d["U"], d["P"], d["C"]) - 1)

Submission status: Accepted

Solution code:
s=input()
print(min(map(lambda c:s.count(c),"KUPC")))

Submission status: Accepted

Solution code:
s=input()
print(min(s.count(c) for c in "KUPC"))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 13 17:35:46 2016

"""
D = {"K":0, "U":0, "P":0, "C":0}
S = input()
for s in S:
    if s in D:
        D[s] += 1
        
print(min(D["K"], D["U"], D["P"], D["C"]))

Submission status: Accepted

Solution code:
# coding: utf-8
s = raw_input();

k = u = p = c = 0;
for a in s:
    if a == 'K':
        k += 1;
    if a == 'U':
        u += 1;
    if a == 'P':
        p += 1;
    if a == 'C':
        c += 1;

print min(k,u,p,c);

Submission status: Accepted

Solution code:
s=input()
print(min(s.count(i) for i in 'KUPC'))

Submission status: Accepted

Solution code:
s=raw_input()
print min(s.count(c) for c in "KUPC")

Submission status: Accepted

Solution code:
import sys

def solve():
    L = raw_input()
    data = []
    data.append(L.count("K"))
    data.append(L.count("U"))
    data.append(L.count("P"))
    data.append(L.count("C"))

    print min(data)
    
                            
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
a = raw_input()
print min([a.count(i) for i in "KUPC"])

Submission status: Accepted

Solution code:
a = raw_input()
print min(a.count(i) for i in "KUPC")

Submission status: Accepted

Solution code:
s=input()
print(min(s.count(x) for x in "KUPC"))

Submission status: Accepted

Solution code:
a=input()
k=a.count('K')
u=a.count('U')
p=a.count('P')
c=a.count('C')
print(min(k,u,p,c))

Submission status: Accepted

Solution code:
a = input()
k = a.count("K")
u = a.count("U")
p = a.count("P")
c = a.count("C")
l = [k, u, p, c]
ans = min(l)
print(ans)

Submission status: Accepted

Solution code:
x=input()
k=x.count('K')
u=x.count('U')
p=x.count('P')
c=x.count('C')
y=[k,u,p,c]
print(min(y))

Submission status: Accepted

Solution code:
n=input()
a=n.count('K')
b=n.count('U')
c=n.count('P')
d=n.count('C')
x=min(a,b,c,d)
print(x)

Submission status: Accepted

Solution code:
a=input()
b=0
c=0
d=0
e=0

for i in range(len(a)):
    if a[i]=='K':
        b +=1
    elif a[i]=='U':
        c +=1
    elif a[i]=='P':
        d +=1
    elif a[i]=='C':
        e +=1
    else:
        pass
print(min(b,c,d,e))

Submission status: Accepted

Solution code:
x=input()

a=int(x.count("K"))
b=int(x.count("U"))
c=int(x.count("P"))
d=int(x.count("C"))

list=list([a,b,c,d])
s=min(list)
print(s)

Submission status: Accepted

Solution code:
a = list(input())

count_K = a.count("K")
count_P = a.count("P")
count_U = a.count("U")
count_C = a.count("C")
print(min(count_K, count_P, count_U, count_C))

Submission status: Accepted

Solution code:
n=input()
s=[0]*26
k=[0]*4
for i in range(len(n)):
    #print(ord(n[i]))
    if 65<=ord(n[i])<=90:
        s[ord(n[i])-65]+=1
k[0]=s[2]
k[1]=s[10]
k[2]=s[15]
k[3]=s[20]
print(min(k))

Submission status: Accepted

Solution code:
from collections import Counter

d = Counter(list(input()))
print(min(d["K"], d["U"], d["P"], d["C"]))

Submission status: Accepted

Solution code:
s=input()
print(min(s.count("K"),s.count("U"),s.count("P"),s.count("C")))

Submission status: Accepted

Solution code:
A=input()
B=(A.count('K'))
C=(A.count('U'))
D=(A.count('P'))
E=(A.count('C'))
print(min(B,C,D,E))

Submission status: Accepted

Solution code:
a=input()

k=a.count('K')
u=a.count('U')
p=a.count('P')
c=a.count('C')
print(min(k,u,p,c))

Submission status: Accepted

Solution code:
x=input()
KUPC=list(0 for i in range(4))
for i in range(len(x)):
    if x[i] == 'K':
        KUPC[0]+=1
    elif x[i] =='U':
        KUPC[1]+=1
    elif x[i] == 'P':
        KUPC[2]+=1
    elif x[i]=='C':
        KUPC[3]+=1
if (KUPC[0]==KUPC[1] and KUPC[1]==KUPC[2] and KUPC[2]==KUPC[3]):
    print(KUPC[0])
else :
    list.sort(KUPC)
    print(KUPC[0])

Submission status: Accepted

Solution code:
x=input()
lis=[]
a=x.count('K')
lis.append(a)
b=x.count('U')
lis.append(b)
c=x.count('P')
lis.append(c)
d=x.count('C')
lis.append(d)
print(min(lis))

Submission status: Accepted

Solution code:
b=[]
a=str(input())
b.append(a.count('K'))
b.append(a.count('U'))
b.append(a.count('P'))
b.append(a.count('C'))

print(min(b))

Submission status: Accepted

Solution code:
n=input()
a=n.count("K")
b=n.count("U")
c=n.count("P")
d=n.count("C")
s=min(a,b,c,d)
print(s)

Submission status: Accepted

Solution code:
a=input()
k=a.count('K')
u=a.count('U')
p=a.count('P')
c=a.count('C')
b=[k,u,p,c]
print(min(b))

Submission status: Accepted

Solution code:
x=input()
print(min(x.count("K"),x.count("U"),x.count("P"),x.count("C")))

Submission status: Accepted

Solution code:
l=list(input())
import collections
c=collections.Counter(l)
a=[]
a.extend([c["K"], c["U"], c["P"], c["C"]])
print(min(a))

Submission status: Accepted

Solution code:
n = input()
print(min(n.count("K"),n.count("U"),n.count("P"),n.count("C")))

Submission status: Accepted

Solution code:
x=list(input())
y=[]

K=x.count("K")
U=x.count("U")
P=x.count("P")
C=x.count("C")

y.append(K)
y.append(U)
y.append(P)
y.append(C)

print(min(y))

Submission status: Accepted

Solution code:
a = list(input())
K = a.count("K")
P = a.count("P")
U = a.count("U")
C = a.count("C")
print(min(K, P, U, C))

Submission status: Accepted

Solution code:
#56KUPC
a=[]
W=str(input())
k=W.count('K')
a.append(k)
u=W.count('U')
a.append(u)
c=W.count('C')
a.append(c)
p=W.count('P')
a.append(p)
print(min(a))

Submission status: Accepted

Solution code:
a = input()

boards = [0 for i in range(4)]

boards[0] = a.count("K")
boards[1] = a.count("U")
boards[2] = a.count("P")
boards[3] = a.count("C")

print(min(boards))

Submission status: Accepted

Solution code:
s=str(input())
a=0
k=s.count('K')
u=s.count('U')
p=s.count('P')
c=s.count('C')
while True:
    if k==0 or u==0 or p==0 or c==0:
        break
    else:
        a+=1; k-=1; u-=1; p-=1; c-=1
print(a)

Submission status: Accepted

Solution code:
moji = str(input())
k = 0
u = 0
p = 0
c = 0
for a in range(len(moji)):
  if moji[a] == "K":
    k += 1
  elif moji[a] == "U":
    u += 1
  elif moji[a] == "P":
    p += 1
  elif moji[a] == "C":
    c += 1
print(min(k,u,p,c))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
x=input()
print(min(x.count('K'),x.count('U'),x.count('P'),x.count('C')))

Submission status: Accepted

Solution code:
 
s=input()
print(min(s.count(x) for x in "KUPC"))

Submission status: Accepted

Solution code:
x=input()
k=x.count('K')
u=x.count('U')
p=x.count('P')
c=x.count('C')
lst=[k,u,p,c]
print(min(lst))

Submission status: Accepted

Solution code:
n = input()
print(min(n.count(x) for x in "KUPC"))

Submission status: Accepted

Solution code:
n = input()
l1 = "KUPC"
l2 = [0] * 4

for i in range(len(n)):
   for j in range(len(l1)):
      if n[i] == l1[j]:
         l2[j] += 1

print(min(l2))

Submission status: Accepted

Solution code:
s=input()
print(min(s.count(c) for c in "KUPC"))

Submission status: Accepted

Solution code:
n = input()
KUPC = ["K", "U", "P", "C"]
kupc = [0 for i in range(4)]

for i in range(len(n)) :
    if n[i] in KUPC :
        kupc[KUPC.index(n[i])] += 1
        
print(min(kupc))

Submission status: Accepted

Solution code:
n = input()
print(min(n.count("K"),n.count("U"),n.count("P"),n.count("C")))

Submission status: Accepted

Solution code:
s=input()
print(min(s.count(i) for i in'KUPC'))

Submission status: Accepted

Solution code:
lst=list(input())
kupc=[]
k=lst.count("K")
kupc.append(k)
u=lst.count("U")
kupc.append(u)
p=lst.count("P")
kupc.append(p)
c=lst.count("C")
kupc.append(c)
print(min(kupc))

Submission status: Accepted

Solution code:
a=list(input())
k=a.count("K")
u=a.count("U")
p=a.count("P")
c=a.count("C")
b=[k,u,p,c]
print(min(b))

Submission status: Accepted

Solution code:
a=input()
print(min(a.count(i) for i in "KUCP"))

Submission status: Accepted

Solution code:
a = input()
n = [a.count('K'), a.count('U'), a.count('P'), a.count('C')]
print(min(n))

Submission status: Accepted

Solution code:
s = input()
print(min(s.count(x) for x in "KUPC"))

Submission status: Accepted

Solution code:
a = input()
print(min(a.count('K'),a.count('U'),a.count('P'),a.count('C')))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = str(input())
print(min(n.count(i) for i in "KUPC"))

Submission status: Accepted

Solution code:
x=str(input())
list=[]
K=x.count("K")
U=x.count("U")
P=x.count("P")
C=x.count("C")
list.append(K)
list.append(U)
list.append(P)
list.append(C)
print(min(list))

Submission status: Accepted

Solution code:
n=input()
print(min(n.count(x) for x in "KUPC"))

Submission status: Accepted

Solution code:
a = input()
Kco = a.count('K')
Uco = a.count('U')
Pco = a.count('P')
Cco = a.count('C')
print(min(Kco, Uco, Pco, Cco))

Submission status: Accepted

Solution code:
n=input()
a = n.count('K')
b = n.count('U')
c = n.count('P')
d = n.count('C')
x=min(a,b,c,d)
print(x)

Submission status: Accepted

Solution code:
a=input()
k=a.count("K")
u=a.count("U")
p=a.count("P")
c=a.count("C")
l=[k,u,p,c]
ans=min(l)
print(ans)

Submission status: Accepted

Solution code:
a = input()
Kco = a.count('K')
Uco = a.count('U')
Pco = a.count('P')
Cco = a.count('C')
print(min(Kco, Uco, Pco, Cco))

Submission status: Accepted

Solution code:
n=input()
print(min(n.count('K'),n.count('U'),n.count('P'),n.count('C')))

Submission status: Accepted

Solution code:
a=input()

k=a.count("K")
u=a.count("U")
p=a.count("P")
c=a.count("C")
print(min(k,u,p,c))

Submission status: Accepted

Solution code:
a=list(input())
print(min(a.count('K'),a.count('U'),a.count('P'),a.count('C')))

Submission status: Accepted

Solution code:
a = input()
l = [a.count('K'), a.count('U'), a.count('P'), a.count('C')]
print(min(l))

Submission status: Accepted

Solution code:
L=[]

A=list(input())

K=A.count("K")
U=A.count("U")
P=A.count("P")
C=A.count("C")

L.append(K)
L.append(U)
L.append(P)
L.append(C)

print(min(L))

Submission status: Accepted

Solution code:
n=input()
a=[]
x=n.count('K')
a.append(x)

y=n.count('U')
a.append(y)

z=n.count('P')
a.append(z)

w=n.count('C')
a.append(w)

print(min(a))

Submission status: Accepted

Solution code:
x='KUPC'
y=[0]*4
z=input()
for i in range(len(z)):
    if z[i] in x:
        y[x.index(z[i])]+=1
    else:
        continue
print(min(y))

Submission status: Accepted

Solution code:
s=input()
k=s.count('K')
u=s.count('U')
p=s.count('P')
c=s.count('C')
l=[k,u,p,c]
print(min(l))

Submission status: Accepted

Solution code:
x =input()
list = [0]*4
list[0] += x.count('K')
list[1] += x.count('U')
list[2] += x.count('P')
list[3] += x.count('C')
print(min(list))

Submission status: Accepted

Solution code:
s=input()
a=s.count("K")
b=s.count("U")
c=s.count("P")
d=s.count("C")
e=[a,b,c,d]
print(min(e))

Submission status: Accepted

Solution code:
l=[]
n=input()
l.append(n.count('K'))
l.append(n.count('U'))
l.append(n.count('C'))
l.append(n.count('P'))
print(min(l))

Submission status: Accepted

Solution code:
A=list(input())
B=A.count("K")
C=A.count("U")
D=A.count("P")
E=A.count("C")
F=[B,C,D,E]
print(min(F))

Submission status: Accepted

Solution code:
txt=str(input())
K=txt.count("K")
U=txt.count("U")
P=txt.count("P")
C=txt.count("C")

print(min(K,U,P,C))

Submission status: Accepted

Solution code:
x = str(input())
x.split()
a = [x.count('K'),x.count('U'),x.count('P'),x.count('C')]
print(min(a))

Submission status: Accepted

Solution code:
str = input()
l = [str.count('K'), str.count('U'), str.count('P'), str.count('C')]
print(min(l))

Submission status: Accepted

Solution code:
alp = str(input())
lst = list(alp)
l = len(lst)
K = 0
U = 0
P = 0
C = 0
for i in range(l):
    if lst[i] == "K": K += 1
    elif lst[i] == "U": U += 1
    elif lst[i] == "P": P += 1
    elif lst[i] == "C": C += 1
print(min(K,U,P,C))

Submission status: Accepted

Solution code:
x = input()
y = list(x)
z=0
a = y.count("K")
b = y.count("U")
c = y.count("P")
d = y.count("C")
while True:
    if a==0 or b==0 or c==0 or d==0:
        break
    
    else:
        z = z+1
        a = a-1
        b = b-1
        c = c-1
        d = d-1
print(z)

Submission status: Accepted

Solution code:
x=input()
l=list(x)
d=[0]*4
h=l.count('K')
d[0]+=h
i=l.count('U')
d[1]+=i
j=l.count('P')
d[2]+=j
k=l.count('C')
d[3]+=k
print(min(d))

Submission status: Accepted

Solution code:
str = input()
L = list(str)
l = []
if L.count('K') == L.count('U') == L.count('P') == L.count('C'):
    print(L.count('K'))
elif L.count('K') == 0 :
    print(0)
elif L.count('U') == 0 :
    print(0)
elif L.count('P') == 0 :
    print(0)
elif L.count('C') == 0 :
    print(0)
else:
    k = L.count('K')
    u = L.count('U')
    p = L.count('P')
    c = L.count('C')
    l.append(k)
    l.append(u)
    l.append(p)
    l.append(c)
    ls = sorted(l)
#    print(l)
    print(ls[len(ls) - 4])
#    print(( L.count('K') + L.count('U') + L.count('P') + L.count('C') )//4)
#    l = []
#    l.append(L.count('K'))
#    l.append(L.count('U'))
#    l.append(L.count('P'))
#    l.append(L.count('C'))
#    print(l[len(l) - 4])

Submission status: Accepted

Solution code:
#56 KUP

s = input()
print(min(s.count(x) for x in "KUPC"))

Submission status: Accepted

Solution code:
a = str(input())
l = list(a)

K = 0
U = 0
P = 0
C = 0

n = len(l)

for i in range(0,n):
    if l[i] == 'K':
        K += 1
    if l[i] == 'U':
        U += 1
    if l[i] == 'P':
        P += 1
    if l[i] == 'C':
        C += 1
                        
min = K
if U < min:
    min = U
if P < min:
    min = P
if C < min:
    min = C
print(min)

Submission status: Accepted

Solution code:
n = str(input())
print(min(n.count('K'),n.count('U'),n.count('P'),n.count('C')))

Submission status: Accepted

Solution code:
a=input()
a=list(a)

l=0
m=0
n=0
o=0

for i in range(len(a)):
    if a[i]=="K":
        l+=1
    if a[i]=="U":
        m+=1
    if a[i]=="P":
        n+=1
    if a[i]=="C":
        o+=1
        
min=l
zero=0
if min>m:
    zero=m
    m=min
    min=zero
zero=0
if min>n:
    zero=n
    n=min
    min=zero
zero=0
if min>o:
    zero=o
    o=min
    min=zero

print(min)

Submission status: Accepted

Solution code:
a=input()

K=a.count('K')
U=a.count('U')
P=a.count('P')
C=a.count('C')
list=[K,U,P,C]
print(min(list))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

s=str(input())
a=0
k=s.count('K')
u=s.count('U')
p=s.count('P')
c=s.count('C')
while True:
    if k==0 or u==0 or p==0 or c==0:
        break
    else:
        a+=1; k-=1; u-=1; p-=1; c-=1
print(a)

Submission status: Accepted

Solution code:
a=input()
K=a.count('K')
U=a.count('U')
P=a.count('P')
C=a.count('C')
print(min(K,U,P,C))

Submission status: Accepted

Solution code:
n = input()
a = list(n)
k = a.count('K')
u = a.count('U')
p = a.count('P')
c = a.count('C')

m = min(k,u,p,c)
print(m)

Submission status: Accepted

Solution code:
n=str(input())

t=list(n)

x=t.count('K')
y=t.count('U')
z=t.count('P')
w=t.count('C')

a=[x,y,z,w]

if x>0 and y>0 and z>0 and w>0:
    print(min(a))
else:
    print(0)

Submission status: Accepted

Solution code:
x=input()

a=int(x.count("K"))
b=int(x.count("U"))
c=int(x.count("P"))
d=int(x.count("C"))

list=list([a,b,c,d])
y=min(list)
print(y)

Submission status: Accepted

Solution code:
s=input()
l=[0,0,0,0]
for i in range(len(s)):
    if s[i]=="K" : l[0]+=1
    if s[i]=="U" : l[1]+=1
    if s[i]=="P" : l[2]+=1
    if s[i]=="C" : l[3]+=1
print(min(l))

Submission status: Accepted

Solution code:
kanban = input()
Kanban = list(kanban)

K_n = 0
U_n = 0
P_n = 0
C_n = 0

for i in Kanban:
    if i == 'K':
        K_n += 1
    elif i == 'U':
        U_n += 1
    elif i == 'P':
        P_n += 1
    elif i == 'C':
        C_n += 1

n = [K_n, U_n, P_n, C_n]
print(min(n))

Submission status: Accepted

Solution code:
k=0
u=0
p=0
c=0
x=0

n=input()

for i in n:
    if i=='K':
        k+=1
    elif  i=='U':
        u+=1
    elif i=='P':
        p+=1
    elif i=='C':
        c+=1
            
    
for j in range(len(n)):
    if k>=1 and u>=1 and p>=1 and c>=1:
        x+=1
        k-=1
        u-=1
        p-=1
        c-=1
    else:
        break
print(x)

Submission status: Accepted

Solution code:
a=input()
K=a.count('K')
U=a.count('U')
P=a.count('P')
C=a.count('C')
sum=min(K,U,P,C)
print(sum)

Submission status: Accepted

Solution code:
x=str(input())
s1=x.count("K")
s2=x.count("U")
s3=x.count("P")
s4=x.count("C")
b=min(s1,s2,s3,s4)
if s1==0 or s2==0 or s3==0 or s4==0:
    b==0
print(b)

Submission status: Accepted

Solution code:
a=list(input())
x=[]
x.append(a.count('K'))
x.append(a.count('U'))
x.append(a.count('P'))
x.append(a.count('C'))
print(min(x))

Submission status: Accepted

Solution code:
a=input()
print(min(a.count("K"),a.count("U"),a.count("P"),a.count("C")))

Submission status: Accepted

Solution code:
str=input()
strl=len(str)
k=u=p=c=0

for i in range(strl):
    a=str[i]
    if a=="K":
        k+=1
    elif a=="U":
        u+=1
    elif a=="P":
        p+=1
    elif a=="C":
        c+=1
    
print(min(k,u,p,c))

Submission status: Accepted

Solution code:
x=str(input())
s1=x.count("K")
s2=x.count("U")
s3=x.count("P")
s4=x.count("C")
b=min(s1,s2,s3,s4)
if s1==0 or s2==0 or s3==0 or s4==0:
    b==0
print(b)

Submission status: Accepted

Solution code:
a = input()

k = a.count('K')
u = a.count('U')
p = a.count('P')
c = a.count('C')

data = [k, u, p, c ]

print(min(data))

Submission status: Accepted

Solution code:
a = str(input())
f = []
c = ['K','U','P','C']
for i in range(0,4):
    b = a.count(c[i])
    f.append(b)
f.sort()
print(f[0])

Submission status: Accepted

Solution code:
s = str(input())

k = (s.count('K'))
u = (s.count('U'))
p = (s.count('P'))
c = (s.count('C'))

x = min(k, u, p, c)
print(x)

Submission status: Accepted

Solution code:
x = input()
a = len(x)
K = 0
U = 0
P = 0
C = 0

for j in range(a):
    if x[j] == 'K':
        K += 1
    if x[j] == 'U':
        U += 1
    if x[j] == 'P':
        P += 1
    if x[j] == 'C':
        C += 1
        
z = min(K,U,P,C)

print(z)

Submission status: Accepted

Solution code:
import sys
input_str=sys.stdin.read()

con=[0]*4
for a in input_str:
    if a=='K':
        con[0]+=1
    elif a=='U':
        con[1]+=1
    elif a=='P':
        con[2]+=1
    elif a=='C':
        con[3]+=1
    else :
        pass
    
print(min(con))

Submission status: Accepted

Solution code:
x=str(input())
a=x.count('K')
b=x.count('U')
c=x.count('P')
d=x.count('C')

l=[a,b,c,d]
print(min(l))

Submission status: Accepted

Solution code:
l=list(input())
m=min(l.count('K'),l.count('U'),l.count('C'),l.count('P'))
print(m)

Submission status: Accepted

Solution code:
#2271
cnt1 = 0
cnt2 = 0
cnt3 = 0
cnt4 = 0
word = str(input())
w2 = len(word)
for i in range(w2):
    if ord('K') == ord(word[i]):
        cnt1 += 1
    if ord('U') == ord(word[i]):
        cnt2 += 1
    if ord('C') == ord(word[i]):
        cnt3 += 1
    if ord('P') == ord(word[i]):
        cnt4 += 1
if cnt1 > cnt2:
    cnt1 = cnt2
if cnt1 > cnt3:
    cnt1 = cnt3
if cnt1 > cnt4:
    cnt1 = cnt4
print(cnt1)

Submission status: Accepted

Solution code:
x=str(input())
S1=x.count("K")
S2=x.count("U")
S3=x.count("P")
S4=x.count("C")
b=min(S1,S2,S3,S4)
if S1==0 or S2==0 or S3==0 or S4==0:
    b=0
print(b)

Submission status: Accepted

Solution code:
x = input()

K=0
U=0
P=0
C=0

for i in range(len(x)):
    if ord('K') == ord(x[i]):
        K += 1
    elif ord('U') == ord(x[i]):
        U += 1
    elif ord('P') == ord(x[i]):
        P += 1
    elif ord('C') == ord(x[i]):
        C += 1

print(min(K,U,P,C))

Submission status: Accepted

Solution code:
# coding: utf-8
# 56

m = input()

K = m.count('K')
U = m.count('U')
P = m.count('P')
C = m.count('C')

A = int(0)

while True:
    if K==0 or U ==0 or P ==0 or C==0:
        break
    
    elif K>=1 or U>=1 or P>=1 or C>=1:
        A += 1
        K -= 1
        U -= 1
        P -= 1
        C -= 1
print(A)

Submission status: Accepted

Solution code:

a = list(input())
k,u,p,c = 0,0,0,0

for i in range(len(a)):
    if a[i]=="K":
        k += 1
    elif a[i]=="U":
        u += 1
    elif a[i]=="P":
        p += 1
    elif a[i]=="C":
        c += 1
    else:
        pass
    
print(min(k,u,p,c))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

n = input()
l1 = "KUPC"
l2 = [0] * 4

for i in range(len(n)):
   for j in range(len(l1)):
      if n[i] == l1[j]:
         l2[j] += 1

#print(l2)
print(min(l2))

Submission status: Accepted

Solution code:
x=input()
a=x.count('K')
b=x.count('U')
c=x.count('P')
d=x.count('C')
y=[a,b,c,d]
Y=sorted(y)
print(Y[0])

Submission status: Accepted

Solution code:
text = input()

textlist = list(text)

l = len(textlist)

countK = 0
countU = 0
countP = 0
countC = 0
for i in range(l):
    if textlist[i]=='K':
        countK += 1
    if textlist[i]=='U':
        countU += 1
    if textlist[i]=='P':
        countP += 1
    if textlist[i]=='C':
        countC += 1

COUNT = []
COUNT.append(countK)
COUNT.append(countU)
COUNT.append(countP)
COUNT.append(countC)
KUPC = min(COUNT)
print(KUPC)

Submission status: Accepted

Solution code:
x=list(input())

a=0
b=0
c=0
d=0

for i in x:
    if i == 'K':
        a+=1
    if i == 'U':
        b+=1
    if i == 'P':
        c+=1
    if i == 'C':
        d+=1
        
y=min(a,b,c,d)

print(y)

Submission status: Accepted

Solution code:
s=str(input())
a=0
k=s.count('K')
u=s.count('U')
p=s.count('P')
c=s.count('C')
while True:
    if k==0 or u==0 or p==0 or c==0:
        break
    else:
        a+=1; k-=1; u-=1; p-=1; c-=1
print(a)

Submission status: Accepted

Solution code:
s=input()
print(min(s.count("K"),s.count("U"),s.count("P"),s.count("C")))

Submission status: Accepted

Solution code:
y=[]
x=input()
l=len(x)
for i in range(l):
    y.append(x[i])
s=[]
k=y.count('K')
u=y.count('U')
p=y.count('P')
c=y.count('C')
s.append(k)
s.append(u)
s.append(p)
s.append(c)
t=min(s)
print(t)

Submission status: Accepted

Solution code:
str1 = input()
str2 = [a for a in str1]
num1_list = []
num1_list.append(str2.count("K"))
num1_list.append(str2.count("U"))
num1_list.append(str2.count("P"))
num1_list.append(str2.count("C"))
num1_list.sort()
print(num1_list[0])

Submission status: Runtime Error

Solution code:
print min(raw_input().count(i) for i in "KUPC")