Problem:

Finding a Word

Write a program which reads a word W and a text T, and prints the number of word W which appears in text T

  T consists of string Ti separated by space characters and newlines. Count the number of Ti which equals to W. The word and text are case insensitive.

Constraints

  
The length of W ≤ 10

  
W consists of lower case letters

The length of T in a line ≤ 1000

Input

  In the first line, the word W is given. In the following lines, the text T is given separated by space characters and newlines.

"END_OF_TEXT" indicates the end of the text.

Output

  Print the number of W in the text.

Sample Input

computer
Nurtures computer scientists and highly-skilled computer engineers
who will create and exploit "knowledge" for the new era.
Provides an outstanding computer environment.
END_OF_TEXT

Sample Output

3



Sample input:
computer
Nurtures computer scientists and highly-skilled computer engineers
who will create and exploit "knowledge" for the new era.
Provides an outstanding computer environment.
END_OF_TEXT


Sample output:
3

Submission status: Accepted

Solution code:
w = input();count = 0;word = '';T = []
w = w.lower()
while True:
    t = input()
    if t=='END_OF_TEXT':
        break
    t = t.lower()
    T.append(t)


for i in range(len(T)):
    for j in range(len(T[i])):        
        if 'a'<=T[i][j]<='z':
            word += T[i][j]
        if T[i][j]==' ' or j==len(T[i])-1:
            if word == w:
                count+=1
            word =''
    
print(count)

Submission status: Accepted

Solution code:
w = input()
count = 0
while True:
    t = input()
    if t == "END_OF_TEXT":
        break
    text = [s.lower() for s in t.split()]
    count += text.count(w)
print(count)

Submission status: Accepted

Solution code:
w = input()
count = 0
while(True):
  t = input()
  if t == "END_OF_TEXT":
    break
  t = t.lower()
  t = list(t.split())
  for i in t:
    if i == w:
      count = count + 1
print(count)

Submission status: Accepted

Solution code:
W=input().lower()
T=[]

while True:
  tmp_line = str(input())
  if tmp_line == "END_OF_TEXT":
    break
  T += tmp_line.lower().split()

ans = 0
for tmp in T:
  if tmp == W:
    ans +=1

print("{:d}".format(ans))

Submission status: Accepted

Solution code:
W = input().lower()
answer = 0
while 1:
    T = input()
    if T == "END_OF_TEXT":
        break
    answer += T.lower().split().count(W)
print(answer)

Submission status: Accepted

Solution code:
W = input().lower()
answer = 0
while 1:
    T = input()
    if T == "END_OF_TEXT":
        break
    answer += T.lower().split().count(W)
print(answer)

Submission status: Accepted

Solution code:
W=input().lower()
A=[]
B={}
while True:
    T=input().split()
    if T[0]=="END_OF_TEXT":
        for s in A:
            if s in B:
                B[s]+=1
            else:
                B[s]=1
        print(B[W])
        break
    else:
        for i in range(len(T)):
            T[i]=T[i].lower()
        A=A+T
        T=[]

Submission status: Accepted

Solution code:
W=input()
a=0
while True:
	n=input()
	if n=='END_OF_TEXT':
		break
	n=(n.lower()).split()
	a+=n.count(W)
print(a)

Submission status: Accepted

Solution code:
w = input()
s = 0
while True:
    st = input()
    if st == "END_OF_TEXT": break
    s += st.lower().split().count(w)
print(s)

Submission status: Accepted

Solution code:
# coding=utf-8

###
### for python program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
# print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
# print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
# print(" {}".format(i), end="")

# def printA(A):
#     for i, n in enumerate(A):
#         print(n, end='')
#         if i != N-1:
#             print(' ', end='')
#     print()

# リスト内包表記 ifあり
# [x-k if x != 0 else x for x in C]

# ソート
# N = N.sort()

# 10000個の素数リスト
# P = mymath.pnum_eratosthenes(105000)

def get_input():
    N = []
    while True:
        try:
            N.append(input())
            #N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

def dist(A, B):
    d = 0
    for i in range(len(A)):
        d += (A[i]-B[i])**2            
    d = d**(1/2)
    return d

S = get_input()

ans = 0

for s in S[1:-1]:
    a = S[0].upper()
    for b in [x for x in s.split()]:
        if a == b.upper():
            ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
w = input().lower()
c = []
s = input()
while(s!= 'END_OF_TEXT'):
  c += s.lower().split();
  s = input()
print(len([x for x in c if x == w]))

Submission status: Accepted

Solution code:
W = input().lower()
c = 0 
 
while True:
  T = input()
  if T == 'END_OF_TEXT':
    break
  c += T.lower().split().count(W)
print(c)

Submission status: Accepted

Solution code:
w = input().lower()
ans = 0
while 1:
  t = input()
  if t == "END_OF_TEXT":
    break
  ans += t.lower().split().count(w)
print(ans)

Submission status: Accepted

Solution code:
W = input().lower()
count = 0
line = []
while True:
    tmp_line = input()
    if tmp_line == "END_OF_TEXT":
        break
    line += tmp_line.lower().split()    
    
for word in line:
    if word == W:
        count += 1
    else:
        pass    
print(count)

Submission status: Accepted

Solution code:
W=input().lower()
T=""
s=""
while True:
    s = input()
    if s=="END_OF_TEXT":
        break
    T=T+s+" "
T=list(T.lower().split())
print(T.count(W))

Submission status: Accepted

Solution code:
count = 0

W = input()

while True:
    line = input()

    if 'END_OF_TEXT' == line:
        break

    words = line.split()

    for word in words:
        if W == word.lower():
            count += 1

print(count)

Submission status: Accepted

Solution code:
#ITP1_9_A
c=0
W=input().lower()
while True:
  T=input()
  if T == "END_OF_TEXT":
    break
  L=T.lower()
  L=L.split(" ")
  for i in range(len(L)):
    if W==L[i]:
      c += 1
    
print(c)

Submission status: Accepted

Solution code:
w = input()
count = 0

while True:
    s = input()
    
    if s == "END_OF_TEXT":
        break
    count += s.lower().split().count(w)
print(count)

Submission status: Accepted

Solution code:
w = input().lower()
count = 0
while True:
  t = input() 
  if t == 'END_OF_TEXT':
    break
  t = t.lower().split()
  for i in t:
    if w == i:
      count += 1

print(count)

Submission status: Accepted

Solution code:
count=0
str=[]
try:
    word=input()
    while True:
        str+=list(input().split())
except EOFError:
    pass
for i in range(len(str)):
    if str[i].lower()==word:
        count+=1
    elif str[i]=='END_OF_TEXT':
        print(count)
        break

Submission status: Accepted

Solution code:
w = input().lower()
text = []
for s in iter(input, 'END_OF_TEXT'):
    text += s.lower().split()
ans = 0
for line in text:
    if w == line:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    total_occurence_num = 0
    word = input()
    while(True):
        input_str = input()
        if (input_str == "END_OF_TEXT"):
            break
        total_occurence_num += sum(map(lambda w: w == word, input_str.strip(".").lower().split()))
    print(f"{total_occurence_num}")

Submission status: Accepted

Solution code:
W = input()
cnt = 0
while True:
    T = input()
    if T == "END_OF_TEXT":
        break
    T = T.split()
    for t in T:
        if W == t.lower():
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
ans = 0
word = raw_input().lower()
while True:
    INPUT = raw_input().split()
    if INPUT[0] == "END_OF_TEXT":
        break
    for i in INPUT:
        if i.lower() == word:
            ans += 1
print ans

Submission status: Accepted

Solution code:
W = input().lower()
c = 0 

while True:
  T = input()
  if T == 'END_OF_TEXT':
    break
  c += T.lower().split().count(W)
print(c)

Submission status: Accepted

Solution code:
w = str(input())
W = str.lower(w)

T_list=[]
while True:
  t = list(map(str, input().split()))
  if 'END_OF_TEXT' in t:
      break
  for i in t:
    T_list.append(str.lower(i))

a = 0
for i in T_list:
  if W == i:
    a = a + 1

print(a)

Submission status: Accepted

Solution code:
W = input().upper()

count = 0
while True :
  T = input()
  if T == 'END_OF_TEXT' :
    break
  T = T.upper().split()

  count += T.count(W)
print(count)

Submission status: Accepted

Solution code:
W = input()

counter = 0
while True:
    T = input().split()
    if T[0] == "END_OF_TEXT":
        break

    for i in range(len(T)):
        T[i] = T[i].lower()
        if T[i] == W:
            counter += 1

print(counter)

Submission status: Accepted

Solution code:
input_word=""
input_text=[]
temp=[]
flg=0
text=""
#正規表現モジュール
import re 

input_word=input()

input_word="\s"+input_word+"\s"

while flg==0:
    input_line=input()
    if input_line=="END_OF_TEXT":
        flg=1
        input_line=""

    else:
        temp=input_line.split()
        input_text.extend(temp)
        temp=[]

for i in input_text:
    text=text+" "+i+" "
matchOB=re.findall(input_word,text, re.IGNORECASE)
print(len(matchOB))

Submission status: Accepted

Solution code:
T = []
W = input().lower()
count = 0
while True:
    str = input()
    if 'END_OF_TEXT' == str:
        break
    else:
        T.append(str.lower().split())

for i in range(len(T)):
    for j in T[i]:
        if W == j:
            count = count + 1
        #print(j)

print(count)

Submission status: Accepted

Solution code:
w=input().lower()
s=[]
cnt=0
while True:
    t=input().split()
    if 'END_OF_TEXT' in t:
        print(cnt)
        break
    for i in t:
        i=i.lower()
        if i==w:
            cnt+=1

Submission status: Accepted

Solution code:
w=str(input()).lower()
t=[]
while True:
	str=list(input().split())
	if "END_OF_TEXT" in str:
			break
	t+=str

t=[i.lower() for i in t]

print(t.count(w))

Submission status: Accepted

Solution code:
import sys
w = input()
print(''.join(sys.stdin.readlines()).replace('\n', ' ').lower().split().count(w))

Submission status: Accepted

Solution code:
w = input()
ans = 0
while True :
    t = input()
    if t == "END_OF_TEXT" : break
    t = t.lower().split()    
    ans += t.count(w)
print(ans)

Submission status: Accepted

Solution code:
count=0
W = input().upper()
while True:
    l = input().split()
    if l[0]=="END_OF_TEXT":
        break
    for i in range(len(l)):
        if l[i].upper()==W:
            count+=1
print(count)

Submission status: Accepted

Solution code:
W=input()
check=0
S=[]
while check==0:
    s=input().split()
    if s!=["END_OF_TEXT"]:
        ls = len(s)
        for i in range(ls):
            S.append(s[i])
    else:
        check=1
count=0
l=len(S)
for i in range(l):
    if S[i].upper()==W.upper():
        count+=1
print(count)

Submission status: Accepted

Solution code:

w = input()
count = 0

while True:
    t = input()
    if t == 'END_OF_TEXT':
        break
    else:
        t = t.lower().split()
        for i in range(len(t)):
            if t[i] == w:
                count+=1

print(count)

Submission status: Accepted

Solution code:
W = input()

count = 0
while True:
  T = input()
  if T == 'END_OF_TEXT':
    break
    
  for i in T.lower().split():
    if i == W:
      count += 1
print(count)

Submission status: Accepted

Solution code:
W = input()
count = 0
while True:
    T = input()
    if T == "END_OF_TEXT":
        break
    t = list(T.split())
    for i in t:
        i = i.lower()
        if i == W:
            count += 1
print(count)

Submission status: Accepted

Solution code:
a=0
s=input().lower()
while True:
    t=input()
    if t=="END_OF_TEXT":
        break
    else:
        a+=sum(i.lower()==s for i in t.split())
#        print(a)
print(a)

Submission status: Accepted

Solution code:
word = input().lower()

ans =0

while True:
  ss = input()
  
  if ss == 'END_OF_TEXT':
    break
    
  ans += len([x for x in ss.lower().split() if x ==word])
  
print(ans)

Submission status: Accepted

Solution code:
W = input()

answer = 0

while True:

    line = input()

    if line == "END_OF_TEXT":
        break

    answer += line.lower().split().count(W)


print(answer)

Submission status: Accepted

Solution code:
w = input()
T = []
while True:
    s = input()
    if s == 'END_OF_TEXT':
        break
    T += s.lower().split()
print(T.count(w))

Submission status: Accepted

Solution code:
import sys

P=str(input()).upper()#大文字小文字を区別しないので大文字で考える
line=[]

#文章を一文にまとめる
while True:
    tmp_line = str(input())
    if tmp_line == 'END_OF_TEXT':
        break
    line += tmp_line.upper().split()

ans = 0

for tmp_word in line:
    if tmp_word == P:
        ans += 1

print("%d"%(ans))

Submission status: Accepted

Solution code:
#ITP1_9_A
import sys

W = input()
T = []
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    T.append(line)
    
count = 0
for line in T:
    #line = line.strip("\n")
    words = line.split()
    for word in words:
        if W == word.lower():
            count+=1
print(count)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    target = input()
    res = 0
    line = input()
    while line != "END_OF_TEXT":
        res += [x.lower() for x in line.split()].count(target)
        line = input()

    print(res)

Submission status: Accepted

Solution code:
W = input()
ans = 0
S = input()
while S != 'END_OF_TEXT':
    ans += [w.lower() for w in S.split()].count(W)
    S = input()
print(ans)

Submission status: Accepted

Solution code:
W = input()
num = 0
while True:
    T = input().split()
    if "END_OF_TEXT" in T:
        break
    for cond in T:
        if W == cond.lower():
            num += 1

print(num)

Submission status: Accepted

Solution code:
W = input().lower()
count = 0
while True:
    T = input()
    if T == "END_OF_TEXT": break
    T = T.lower()
    
    t = T.split(" ")
    
    for i in t:
        if(i==W):
            count += 1

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# coding: utf_8

import sys

W=input()
sent=sys.stdin.read()
print(sent.lower().split().count(W))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
	W = str(input())
	T = " "
	d = str(input())
	T += d + " "
	while d != "END_OF_TEXT":
		d = str(input())
		T += d+" "
	c = 0
	T = T.lower().replace("\"","").replace("\'","")
	while True:
		if T.find(" "+W+" ") == -1:
			break
		else:
			T=T.replace(" "+W+" "," ",1)	
			c += 1	
	print(c)

Submission status: Accepted

Solution code:
w = input()
cnt = 0
while True:
  str = input()
  if str == "END_OF_TEXT":
    break
  str = str.lower()
  lst = str.split(" ")
  for i in range(len(lst)):
    if w == lst[i]:
      cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
word = input()
count = 0
while True:
    s = input().split()
    if s[0] == "END_OF_TEXT":
        break
    for i in s:
        if i.lower() == word.lower():
            count += 1
print(count)

Submission status: Accepted

Solution code:
x = input()
y = ''
c = 0
while 1:
    p = input()
    if p == 'END_OF_TEXT':
        break
    else:
        y += (p + ' ')
for v in str.lower(y).split():
    if x == v:
        c += 1
print(c)

Submission status: Accepted

Solution code:
import sys
w = next(sys.stdin).strip()
print(sys.stdin.read().lower().split().count(w))

Submission status: Accepted

Solution code:
z = input()
y = []
while True:
    x = input()
    
    if x == "END_OF_TEXT":
        break

    x = x.lower()
    x = x.split()
    y.extend(x)

ans = y.count(z)
print(ans)

Submission status: Accepted

Solution code:
import string

punc = string.punctuation
s = input()
count = 0
line = input()
while line != 'END_OF_TEXT':
    line = line.lower()
    for p in punc:
        line.replace(p, ' ')
    words = line.split()
    for w in words:
        if w == s:
            count += 1
    line = input()
print(count)

Submission status: Accepted

Solution code:
s=[]
w=input()
while 1:
    x = input()
    if x=='END_OF_TEXT':break
    s+=x.strip('.').lower().split()
print(s.count(w))

Submission status: Accepted

Solution code:
pattern = input().lower()
contents = []
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
    line_list = line.split()
    line_list = [string.lower() for string in line_list]
    contents.append(line_list)

counter = 0
for row in contents:
    match_count = row.count(pattern)
    counter += match_count

print(counter)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# ITP1_9_A
# 単語の検索

word_cnt = 0
chk_word = input().lower()

while 1:
    line = input()
    if line == "END_OF_TEXT":
        break
    for word in line.split():
        if word.lower() == chk_word:
            word_cnt += 1
print(word_cnt)

Submission status: Accepted

Solution code:
W = input().upper()

i = 0
while True:
  S = input()
  if S == 'END_OF_TEXT':break

  i += S.upper().split().count(W)
print(i)

Submission status: Accepted

Solution code:
p = str(input()).upper()
line = []
 
while True:
    tmp_line = str(input())
    if tmp_line == 'END_OF_TEXT':
        break
    line += tmp_line.upper().split()
 
ans = 0

for tmp_word in line:
    if tmp_word == p:
        ans += 1
 
print("%d"%(ans))

Submission status: Accepted

Solution code:
word = input().upper()

ans = 0
data = []

while True:
  text = input()

  if text == "END_OF_TEXT":
    break

  data = text.upper().split()

  for i in data:
    if word == i:
      ans += 1


print(ans)

Submission status: Accepted

Solution code:
w = input()

str =""
while True:
        t =  input()
        if t == "END_OF_TEXT":
                break
        else:
                str += t + " "
        
str = str.lower()

num = 0
i = -1
l = len(w)

while True:
        i = str.find(w, i + 1)
        if i == -1:
                break
        elif (i == 0 or str[i-1] == " ") and (i+l == len(str) or str[i+l] == " " or str[i+l] == "." or str[i+l] == ","):
                num += 1

print(num)

Submission status: Accepted

Solution code:
chk_word = input().lower()

words = [] #入力情報の単語リスト
while True:
    sentence = input()
    if sentence == "END_OF_TEXT": #END_OF_TEXTまで読み込む
        break
    else:
        word = sentence.lower().split() #読み込んだ文章を単語に分割
        words.append(word) #単語を単語リストに加える（リスト内リストになっている）

count = 0
for i in range(len(words)):
    for j in range(len(words[i])):
        if chk_word == words[i][j]:
            count += 1
print(count)

Submission status: Accepted

Solution code:
w = input()
counter = 0

while True:
        i = input()
        if i == 'END_OF_TEXT':
            break
        words = i.lower().split()
        counter += words.count(w)


print(counter)

Submission status: Accepted

Solution code:
w = input()
ans = 0

while True:
    ti = input()
    if ti == "END_OF_TEXT":
        break
    ti = list(map(str, ti.split()))
    for i in ti:
        if i.lower() == w:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
W = input()
t = []
count = 0
c = 0

while True:
    T = input()
    if T == "END_OF_TEXT":
        break
    else:
        t.append(T)
        c += 1

for i in range(c):
    l = t[i].split()
    m = len(l)
    for j in range(m):
        l[j] = l[j].lower()
        if l[j] == W:
            count += 1

print(count)

Submission status: Accepted

Solution code:
word = str(input()).upper()

line = []

while True:
    sentense = str(input())
    if sentense == "END_OF_TEXT":
         break
    line += sentense.upper().split()

ans = 0

for i in line:
    if word == i:
        ans += 1

print("%d" %(ans))

Submission status: Accepted

Solution code:
W = input().upper()
ans = 0
while True:
    T = input()
    T_list = T.split(" ")
    for T_current in T_list:
        if T_current == "END_OF_TEXT":
            break
        if T_current.upper() == W:
            ans += 1
    if T_current == "END_OF_TEXT" :
        break
print(ans)

Submission status: Accepted

Solution code:
w = input()

r=[]

while 1:
    r1=input()
    if "END_OF_TEXT" in r1:
        break
    else:
        r+=r1.lower().split()
        
count=0
for i in range(len(r)):
    if r[i]==w:
        count+=1


print(count)

Submission status: Accepted

Solution code:
import sys
w = input()
print (sum([ i.split(' ').count(w) for i in sys.stdin.read().lower().split('\n')]))

Submission status: Accepted

Solution code:
w = input()
c = 0
while True:
    t = input()
    if t == "END_OF_TEXT":
        break
    else:
        tl = t.split()
        for word in tl:
            k = word.lower()
            if k == w:
                c += 1
print(c)

Submission status: Accepted

Solution code:
k = input()
con = {k:0}
num = 0
while 1:
    j = input().split()
    for n in range(len(j)):
        if j[n].lower() in con:
            con[j[n].lower() ] += 1
    else:
        if j[n] == "END_OF_TEXT":
            break
print(con[k])

Submission status: Accepted

Solution code:
s = input()
a = []
while True:
    n = input()
    if n == "END_OF_TEXT":
        break
    a+=[j.lower() for j in n.split()]

print (a.count(s))

Submission status: Accepted

Solution code:
cnt = 0
word = input().lower()
while True:
  str = input()
  if str == 'END_OF_TEXT':
    break
  cnt += str.lower().split().count(word)
print(cnt)

Submission status: Accepted

Solution code:
w = input()
t = ""
while True:
  line = input()
  if line == "END_OF_TEXT":
    break
  else:
    t += " " + line.lower()

words = t.split()
counter = 0
for i in range(len(words)):
  if words[i] == w:
    counter += 1

print(counter)

Submission status: Accepted

Solution code:
W=input()
T=[]
while True:
    Tr=input()
    if Tr =="END_OF_TEXT":break
    T+=Tr.lower().split()
print(T.count(W))

Submission status: Accepted

Solution code:
W = input().upper()
ans = 0


while True:
    T = input()
    if T == "END_OF_TEXT":
        break
    T = T.upper().split()
    ans += T.count(W)
    
print(ans)

Submission status: Accepted

Solution code:
def main():
    word = input()

    cnt = 0
    while True:
        text = input()
        text = text.strip()
        if text == "END_OF_TEXT":
            break

        for t in text.split():
            if t.lower() == word:
                cnt += 1


    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# coding: utf-8
W = input().rstrip()
num = 0
flag = True
while flag:
    t = input().rstrip().split()
    for i in t:
        if i == "END_OF_TEXT":
            flag = False
            break
        if i.lower() == W:
            num += 1

print(num)

Submission status: Accepted

Solution code:
import sys
w = input()
t = sys.stdin.read().lower().split()
print(t.count(w))

Submission status: Accepted

Solution code:
word = input().lower()

counter = 0
while True:
    row = input()
    if row != 'END_OF_TEXT':
        counter += row.lower().split().count(word)
    else:
        break
print(counter)

Submission status: Accepted

Solution code:
w = input()
cnt = 0
while True:
    s = input()
    if s == 'END_OF_TEXT':
        break
    se = ''
    for c in s:
        if ord('A') <= ord(c) <=ord('Z'):
            se += chr(ord(c) + 32)
        else: se += c
    sent = se.split() 
    for wd in sent:
        if wd == w: cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
w = input().lower()
a = 0

while 1:
    t = input()
    if t == "END_OF_TEXT":
        break
    a += t.lower().split().count(w)

print(a)

Submission status: Accepted

Solution code:
def toSmall(word):
    res = ""
    for c in word:
        if(ord('A') <= ord(c) <= ord('Z')):
            res += chr(ord(c) - ord('A') + ord('a'))
        else:
            res += c
    return res

w = toSmall(input())
ans = 0

while True:
    s = input()
    if s == "END_OF_TEXT":
        break

    s = list(map(str, s.split()))
    for x in s:
        if toSmall(x) == w:
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
target=input()
cnt = 0
while True:
    line = list(input().split())
    if line[0] == "END_OF_TEXT":
        break
    size = len(line)
    for i in range(size):
        if line[i].lower() == target:
            cnt += 1
print(str(cnt))

Submission status: Accepted

Solution code:
compare = input().lower()
c = 0
while True:
        str = input()
        if str == "END_OF_TEXT":
                break
        strList = str.split()
        for i in range(len(strList)):
                if compare == strList[i].lower():
                        c += 1

print(c)

Submission status: Accepted

Solution code:
W = input().lower()

count = 0

while 1:
    T = input()
    if T == 'END_OF_TEXT':
        break
    count += T.lower().split().count(W)
print(count)

Submission status: Accepted

Solution code:
W = input()
sum = 0
while True:
    T = list(map(str,input().split()))
    if T[0]=="END_OF_TEXT":break
    
    for word  in T:
        if word.lower() == W:sum+=1
print(sum)

Submission status: Accepted

Solution code:
W = input()
sum = 0
while True:
    T = list(map(str,input().split()))
    if T[0]=="END_OF_TEXT":break
    for word in T:
        if word.lower() == W:sum+=1
print(sum)

Submission status: Accepted

Solution code:
W = input().upper()
count = 0
while True:
    sent = input()
    if sent == "END_OF_TEXT":
        break
    count += sent.upper().split().count(W)
print(count)

Submission status: Accepted

Solution code:
W = input()
counter = 0
while True:
    T = input()
    if T == 'END_OF_TEXT':
        break
    counter += T.lower().split().count(W)
print(counter)

Submission status: Accepted

Solution code:
w = input().lower()
t = list()
while True:
    s = input()
    if s == 'END_OF_TEXT':
        break
    t += s.lower().split()
print(t.count(w))

Submission status: Accepted

Solution code:
w = input()
dic = dict()

while True:
    line = input()
    if line == "END_OF_TEXT":
        break

    for t in line.split():
        dic[t] = dic[t] + 1 if t in dic else 1

ans = 0

for k, v in dic.items():
    if k.lower() == w:
        ans += v

print(ans)

Submission status: Accepted

Solution code:
import sys
w = input()
t = sys.stdin.read().lower().split()
print(t.count(w))

Submission status: Accepted

Solution code:
p = input()

sum = 0
while True:
    a = input()
    if a == 'END_OF_TEXT':
        break
    b = a.lower()
    #print(b)
    c = b.split()
    #print(c)
    num = c.count(p)
    sum += num
    
print(sum)

Submission status: Accepted

Solution code:
cnt = 0
W = input().upper()
while True:
    inT = input().split() 
    if inT[0] == "END_OF_TEXT":
        break
    else:
        T = [inT[i].upper() for i in range(len(inT))]
        cnt += T.count(W)
print(cnt)

Submission status: Accepted

Solution code:
a = "abcdefghijklmnopqrstuvwxyz"
A = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
dic = dict(zip(A,a))

w = input()
tex = []
while(1):
    t = input()
    if t == "END_OF_TEXT":
        break
    tex.extend(t.split())
c = 0
tex_ = []
for i in tex:
    i = list(i)
    for j in range(len(i)):
        if i[j] in A:
            i[j] = dic[i[j]]
    tex_.append("".join(i))
for i in tex_:
    if i == w:
        c += 1
print(c)

Submission status: Accepted

Solution code:
w = input().lower()
words = []
while True:
    tmp_line = input()
    if tmp_line == "END_OF_TEXT":
        break
    words += tmp_line.lower().split()

    

cnt = 0

for word in words:
    if word == w:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import sys
s=input()
c=sys.stdin.read().lower().split()
print(c.count(s))

Submission status: Accepted

Solution code:
import sys

w = sys.stdin.readline().strip().lower()

count = 0

for line in sys.stdin:
    text = line.strip()
    if text == 'END_OF_TEXT':
        break
    words = line.lower().split()
    count += words.count(w)

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

w = sys.stdin.readline().strip().lower()

words = list()

while True:
    s = sys.stdin.readline().strip()
    if s == 'END_OF_TEXT':
        break
    words.extend(s.lower().split())

print(words.count(w))

Submission status: Accepted

Solution code:
W = input()
T = []
c = 0

while True:
    x = input().split()
    if 'END_OF_TEXT' in x:
        break
    T.append(x)

for i in T:
    i = [j.lower() for j in i]
    c += i.count(W)

print(c)

Submission status: Accepted

Solution code:
w=input().lower()
c=[];s=input()
while(s!='END_OF_TEXT'):
    c+=s.lower().split();
    s=input()
print(c.count(w))

Submission status: Accepted

Solution code:
ptn = input()
count = 0
for line in iter(input, 'END_OF_TEXT'):
    count += len([x for x in (line.lower()).split(' ') if x == ptn])
print(count)

Submission status: Accepted

Solution code:
def main():
	wordCount = {}
	W = input()
	while True:
		line = input()
		if line == 'END_OF_TEXT':
			break
		line = line.lower()
		for word in line.split():
			if word in wordCount:
				wordCount[word] += 1
			else:
				wordCount[word] = 1
	print(wordCount[W])
	
main()

Submission status: Accepted

Solution code:
w=input()
w_count=0
T=[]
t=list(map(str,input().split()))

while t!=['END_OF_TEXT']:
    for i in range(len(t)):
        t[i]=t[i].lower()
    T.append(t)
    t=list(map(str,input().split()))

for i in range(len(T)):
    for j in range(len(T[i])):
        if T[i][j]==w:
            w_count=w_count+1
print(w_count)

Submission status: Accepted

Solution code:
word =str(input()).lower()
cnt = 0
while True:
    try:
        m = str(input())
    except EOFError:
        break
    if ( m == "END_OF_TEXT"):
        break
    for i in  m.lower().split():
        if ( i == word):
            cnt += 1
print (cnt)

Submission status: Accepted

Solution code:
def countString(word, text):
    counter = 0
    for t in text:
        if t == word:
            counter += 1
    print(counter)

if __name__ == '__main__':
    w = input()
    mojiretsu = []
    while True:
        s = input()
        if s == "END_OF_TEXT":
            break
        moji = s.lower().split()
        for m in moji:
            mojiretsu.append(m)
    countString(w, mojiretsu)

Submission status: Accepted

Solution code:
import sys
w = input()
t = list(sys.stdin.read().lower().replace(".", " ").split())
print(t.count(w))