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()
cnt = 0
a = []
while True:
    t = input()
    if "END_OF_TEXT" in t:
        break
    a += t.lower().split()
for i in a:
    if i == w:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
w=input().upper()
cnt=0
while True:
    block=input()
    if block == 'END_OF_TEXT':
        break
    else:
        z=block.upper().split()
        a=z.count(w)
        cnt += int(a)
print(cnt)

Submission status: Accepted

Solution code:
s=input()
count=0
while True:
    try:
        a=list(input().split())
    except:
        break
    for i in a:
        if s==i.lower():
            count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input()

cnt = 0
while True:
    s = input()
    if s == "END_OF_TEXT":
        print(cnt)
        exit()
    s = s.lower()
    sl = list(s.split())
    cnt += sl.count(W)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input()
count_same = 0

while True:
    T = [x for x in input().split(' ')]
    
    if ''.join(T) == 'END_OF_TEXT':
        break
    
    text_lower = []
    for i in range(len(T)):
        one_T = T[i]
        one_T_list = []
        for k in range(len(one_T)):
            if one_T[k].isupper():
                one_T_lower = one_T[k].lower()
            else:
                one_T_lower = one_T[k]
            one_T_list.append(one_T_lower)
        text_lower.append(''.join(one_T_list))
    
    count_same += text_lower.count(W)
    
print(count_same)

Submission status: Accepted

Solution code:
w = input()
ans = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break

    line = line.lower()
    texts = line.split()
    for text in texts:
        if text == w:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
w = input()
count = 0

while True:
    sc = input()
    if sc == 'END_OF_TEXT':
        break;
    list = sc.split()
    for word in list:
        word.replace('.','')
        if w == word.lower():
            count += 1
print(count)

Submission status: Accepted

Solution code:
W = input()
count = 0
while 1:
    S = input()
    if S == 'END_OF_TEXT':
        print(count)
        break
    s = S.lower().split()
    for x in s:
        if x == W:
            count += 1

Submission status: Accepted

Solution code:
W = input()
W = '^' + W + '$'
c = 0
while True:
    Ti = input()
    if Ti == 'END_OF_TEXT':
        break
    c += sum(['^' + t + '$' == W for t in Ti.lower().split(' ')])
print(c)

Submission status: Accepted

Solution code:
import sys
import itertools
import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

W = readline().decode('utf8').rstrip()

T = read().decode('utf8').lower().split()
print(T.count(W))

Submission status: Accepted

Solution code:
W = input().lower()
T = []
while True:
    tmp = input()
    if tmp == "END_OF_TEXT":
        break
    T += tmp.lower().split(" ")
print(len(list(filter(lambda x: x == W, T))))

Submission status: Accepted

Solution code:
import sys
w = input()

print(sys.stdin.read().lower().split().count(w))

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

for T in sys.stdin :
    if T == "END_OF_TEXT" :
        break
    T = T.upper()
    T = T.split()
    for t in T :
        if t == W :
            count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections 
import sys
w = input()
t = []
while True:
    tmp = input()
    if tmp=='END_OF_TEXT':
        break
    t.extend(tmp.lower().split())

c = collections.Counter(t)
print(c[w])

Submission status: Accepted

Solution code:
W = input()
count = 0

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

print(count)

Submission status: Accepted

Solution code:
w = input()
*t, = map(str, input().split())
ans = 0
while t[0] != "END_OF_TEXT":
    ans += sum(map(lambda x: x.lower() == w, t))

    *t, = map(str, input().split())

print(ans)

Submission status: Accepted

Solution code:
w = input()
t = ''
while True:
    s = input()
    if s == 'END_OF_TEXT':
        break
    else:
        s = s.replace('-', ' ').replace('.', '').replace('"', '')
        t += ' ' + s.lower()
t = t.split()
print(t.count(w))

Submission status: Accepted

Solution code:
s = 0
b = input().lower()

while(True):
    a = input()
    if(a=="END_OF_TEXT"):
        break
    a = a.lower()
    nn = a.split(" ")
    for n in nn:
        if (n == b):
            s += 1
print(s)

Submission status: Accepted

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

count = 0

while True:
    
    line = input()
    
    if line == 'END_OF_TEXT':
        break
    
    for s in line.split():
        if s.upper() == w:
            count += 1
print(count)

Submission status: Accepted

Solution code:
st = input().lower()
cnt = 0
while True:
    try:
        txt = list(input().lower().split())
        for t in txt:
            if t==st:
                cnt+=1
    except:
        break

print(cnt)

Submission status: Accepted

Solution code:
import sys

W = str(input()).upper()

line = []

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

cnt = 0

for tmp_word in line:
  if tmp_word == W:
    cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input()
t = []
tmp = input()
while tmp != "END_OF_TEXT":
    lst = tmp.split(' ')
    for i in range(len(lst)):
        t.append(lst[i])
    tmp = input()

ans = 0
for i in range(len(t)):
    count = 0
    if (len(t[i]) == len(w)):
        for j in range(len(w)):
            if (t[i][j] == w[j]):
                count += 1
            elif (ord(t[i][j]) + ord("a") - ord("A") == ord(w[j])):
                count += 1
        if count == len(w):
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
word = input()
sentence = []

EOT = "END_OF_TEXT"

while True:
    inp = input()
    if inp == EOT:
        break

    sentence.append((inp.lower()).split())

answer = 0
for i in range(len(sentence)):
    answer += sentence[i].count(word)

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import sys

w=input()

print(sys.stdin.read().lower().split().count(w))

Submission status: Accepted

Solution code:
w = input().upper()
t = ''
for _ in range(10000):
    te = input()
    if te == 'END_OF_TEXT':
        break
    else:
        t += (' ' + te.upper() + ' ')

t_list = t.split()
print(t_list.count(w))

Submission status: Accepted

Solution code:
W = input()
W = W.lower()
N = 0
while True:
 T = list(input().split())
 if len(T)==0:
  continue
 if T[0]=="END_OF_TEXT":
  break
 for ti in range(len(T)):
  if T[ti].lower()==W:
   N = N+1
print(N)

Submission status: Accepted

Solution code:
W = input().lower()
cnt = 0
while True:
    x_line = input().split(' ')
    if 'END_OF_TEXT' in x_line:
        break
    for i in x_line:
        if i.lower() == W:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
#インプットdataの格納
juge_letter = input().lower()
input_letter = list()
while True:
    input_letter_temp = input()
    if input_letter_temp == "END_OF_TEXT":
        break
    input_letter += input_letter_temp.lower().split()

#判定結果
print(input_letter.count(juge_letter))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input()
count = 0
while True:
    *T, = input().split()
    if T[0] == 'END_OF_TEXT':
        break
    T = [t.lower() for t in T]
    count += T.count(W)
print(count)

Submission status: Accepted

Solution code:
search = input().lower()
ans = 0
while True:
    s = input().split()
    if s[0] == "END_OF_TEXT":
        break
    
    s = [i.lower() for i in s]


    ans += s.count(search)

print(ans)

Submission status: Accepted

Solution code:
B=[]
A = str(input())
A= A.lower()
while True:
    B.extend(input().split())
    if B.count('END_OF_TEXT')==1:
        break
B = list(map(str.lower,B))
print(B.count(A))

Submission status: Accepted

Solution code:
W = input()
text = []
while True:
    t = input()
    if t == 'END_OF_TEXT':
        break
    text += t.lower().split()
ans = text.count(W)
print(ans)

Submission status: Accepted

Solution code:
cnt = 0
w = input()

while True:
  t = input()
  if t == 'END_OF_TEXT':
    break
  else:
    cnt += t.lower().split(' ').count(w)

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

result = 0
while True:
    t = input()
    
    if t == "END_OF_TEXT":
        break
    else:
        pass
    
    result += t.lower().split().count(w)
print(result)

Submission status: Accepted

Solution code:
w = input()
ans = 0
while True:
	line = input()
	if line == "END_OF_TEXT":
		break
	ans += list(map(lambda x:x.lower(), line.split())).count(w)
print(ans)

Submission status: Accepted

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

ctr = 0
while 1:
  try:
    T = input().lower()
    for a in T.split():
      if a == W:
        ctr += 1
  except EOFError:
    break

print(ctr)

Submission status: Accepted

Solution code:
import re

# Wを受け取る
W = input()
wlen = len(W)

# Tを受け取る
T = ""
while True:
    Ti = input()
    if Ti == "END_OF_TEXT":
        break
    T += Ti + " "

# 処理実行
T_list = list(T.split(" "))
result = 0
for t in T_list:
    cnt = len(re.findall(W, t, flags=re.IGNORECASE))
    strlen = len(t)
    if cnt == 1 and strlen == wlen:
        result += 1
    else:
        pass

print(result)

Submission status: Accepted

Solution code:
w=raw_input()
c=0
while True:
    a=map(str,raw_input().split())
    for i in a:
        if i.lower()==w:
            c+=1
        if i=="END_OF_TEXT":
            break
    else:
        continue
    break
print c

Submission status: Accepted

Solution code:
def finding_word(target_w, w_list):
    n = w_list.count(target_w)

    print(str(n))

if __name__ == "__main__":

    target_w = input()
    w_list   = list()

    while(True):
        line = input()

        if line == "END_OF_TEXT":
            break

        line = line.split(" ")
        for w in line:
            w_list.append(w.lower())

    finding_word(target_w, w_list)

Submission status: Accepted

Solution code:
import collections
import re
import sys


w = input().lower()
t = sys.stdin.read()
t.replace("END_OF_TEXT", "")
t = re.sub(r"[^a-z\s]]", "", t.lower())
t = t.split()
counter = collections.Counter(t)
ans = counter[w]

print(ans)

Submission status: Accepted

Solution code:
target = input()

count = 0

while True:
    sentence = input()
    if sentence == "END_OF_TEXT":
        break
        
    temp = sentence.split()
    for word in temp:
        
        if word.lower() == target:
            count += 1

print(count)

Submission status: Accepted

Solution code:
W = input().upper()
count = 0
while True:
    T = input()
    if T == 'END_OF_TEXT':
        break
    for word in T.split():
        if W == word.upper():
            count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input()
r = 0
while True:
    for s in input().split():
        if s == "END_OF_TEXT":
            print(r)
            exit()
        if s.lower() == w:
            r += 1

Submission status: Accepted

Solution code:
kw = input()
n_of_kw = 0

while True:
    sentence = input().split(" ")
   
    if sentence[0] == "END_OF_TEXT":
        break
    else:
        sentence2 = []
        for i in sentence:
            sentence2.append(i.lower())
        n_of_kw += sentence2.count(kw)
      
print(n_of_kw)

Submission status: Accepted

Solution code:
import sys
W=input()
s=0
while True:
    a=input()
    if a=="END_OF_TEXT":
        break
    s+=a.lower().split().count(W)
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input()
count_W = 0
while True:
    s = input()
    if s == 'END_OF_TEXT':
        break
    else:
        count_W += s.lower().split().count(W)

print(count_W)

Submission status: Accepted

Solution code:
W, *S = open(0).read().lower().split()
print(S.count(W))

Submission status: Accepted

Solution code:
dic = {}
for i in range(97, 123):
    dic[chr(i)] = 0

w = input().strip().lower()

total = 0
while True:
    s = input().strip()
    if s == "END_OF_TEXT":
        break

    for sl in s.lower().split():
        word = ""
        for c in sl:
            if c in dic:
                word += c
        if word == w:
            total += 1

print(total)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    #h0,w0h1,w1 = map(int, input().split())
    s=sys.stdin.readline()[:-1]
    t=sys.stdin.read().split()
    ans=0
    for i,w in enumerate(t):
        nw="".join(c.lower() if c.isupper else c for c in w)
        if nw==s:ans+=1
    print(ans)

main()

Submission status: Accepted

Solution code:
w = input()

res = 0
while True:
    text = input()

    if text == 'END_OF_TEXT':
        break

    text = text.lower()
    text = text.split(" ")
    for word in text:
        if word == w:
            res += 1

print(res)

Submission status: Accepted

Solution code:
a = input()
count = 0
words = []
while True:
  word = input().split()
  if word[0] == "END_OF_TEXT":
    break
  for subword in word:
    words.append(subword)
for b in words:
  if b.lower() == a:
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input().lower()
S = []

while True:
    s = input()
    
    if s == 'END_OF_TEXT':
        break
    else:
        S.extend([s_.lower() for s_ in s.split()])
        
count = 0
for s in S:
    if w == s:
        count += 1
        
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input().lower()
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()
n,t = 0,input()
while (t!="END_OF_TEXT"):
        t = list(((t.replace(".","")).lower()).split())
        n += t.count(w)
        t = input()
print(n)

Submission status: Accepted

Solution code:
s = input()
t = input()
ans = 0
while True:
    if t == "END_OF_TEXT":
        break
    t = t.split()
    for x in t:
        if s == x.lower():
            ans += 1
    t = input()
print(ans)

Submission status: Accepted

Solution code:
w=input()
res=0
while True:
    q=input()
    if q == "END_OF_TEXT":
        break
    else:
        q=q.lower().split()
        c=q.count(w)
        res=res+c
print(res)

Submission status: Accepted

Solution code:
import sys
x=sys.stdin.read().lower()
k=x.split('\n')
t=x.rindex('end_of_text')
k=k[0]
count=-1
curr=1
x=x.split()
while k in x:
    x.remove(k)
    count+=1
print(count)

Submission status: Accepted

Solution code:
W = input().lower()
T = list(iter(input, 'END_OF_TEXT'))
counter = 0
for t in T:
    for word in t.split():
        if word.lower() == W:
            counter += 1
print(counter)

Submission status: Accepted

Solution code:
word = input()
text = ''
line = input()
while(line != 'END_OF_TEXT'):
    text = text +' '+ line.lower()
    #print(text)
    line = input()

token = text.split()
count = 0
for _ in token:
    #print(_)
    if (_ == word):
        count += 1
        #print(count)

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

while True:
    word=input()
    if word=="END_OF_TEXT":
        break
    sen+=word.lower().split()

ans=0

for w in sen:
    if W==w:
        ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

while True:
    new = input()
    if new == "END_OF_TEXT":
        break
    else:
        line = new.lower().split(" ")
        for word in line:
            if word == W:
                count = count +1
print(count)

Submission status: Accepted

Solution code:
S = input()
count = 0
while True:
    line = input()
    if(line == "END_OF_TEXT"):break
    line = line.lower()
    for word in line.split():
        #print(word)
        if(word == S) :
           count += 1
print(count)

Submission status: Accepted

Solution code:
word = input()
words = {}
while True:
    input_line = input()
    if input_line == "END_OF_TEXT":
        break
    for w in input_line.split():
        tmp = words.setdefault(w.lower(), 0)
        words[w.lower()] = tmp + 1
if word in words.keys():
    print(words[word])
else:
    print("0")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s = s.upper()
ans = 0
while True:
    t = input()
    a = t.split(" ")
    for i in range(len(a)):
        x = a[i].upper()
        if x == s:
            ans += 1
    if t == "END_OF_TEXT":
        break
print(ans)

Submission status: Accepted

Solution code:
searchWord=input()
sentences=[]

while True:
    line=input().split(" ")
    if line==["END_OF_TEXT"]:
        break
    else:
        sentences.append(line)

count=0

for line in sentences:
    for word in line:
        lowerWord=word.lower()
        if searchWord==lowerWord:
            count+=1

print(count)

Submission status: Accepted

Solution code:
w=input().lower()
ans=0
while True:
    t=input()
    if t=="END_OF_TEXT":
        break
    else:
        t=t.split()
        for i,j in enumerate(t):
          t[i]=j.lower()
        ans+=t.count(w)
print(ans)

Submission status: Accepted

Solution code:
target = input()
word_count = 0

while True:
    line = input()
    if line == 'END_OF_TEXT':
        break;
    words = line.lower().split()
    for word in words:
        word = word.strip(' .,"\'')
        if word == target:
            word_count += 1
print(word_count)

Submission status: Accepted

Solution code:
counter = 0
W = input()

while True:
    text = input()
    if text == "END_OF_TEXT":
        break
    else:
        text_list = text.upper().split()
        counter += text_list.count(W.upper())
        
print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w=input()
T=[]
while 1:
    s=input()
    if s=="END_OF_TEXT":break
    T +=s.lower().split()
count=0
for i in T:
    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
    else:
        count += T.lower().split().count(W)

print(count)

Submission status: Accepted

Solution code:
import sys

w = str(input()).lower()
text = []

while True:
    words = str(input())
    if words == 'END_OF_TEXT':
        break
    text += words.lower().split()

count = 0
for word in text:
    if word == w:
        count += 1
print(count)

Submission status: Accepted

Solution code:
word = input()
res = 0
while True:
    temp = input().split()
    if temp == ['END_OF_TEXT']:
        break
    for i in range(len(temp)):
        temp[i] = str.lower(temp[i])
        if temp[i] == word:
            res += 1

print(res)

Submission status: Accepted

Solution code:
w = input()
t = ""
while True:
    t += "\n" + input()
    if t.endswith("END_OF_TEXT"):
        t = t[:-11]
        break
print(t.lower().split().count(w))

Submission status: Accepted

Solution code:
counter = 0

n = input()
n = n.lower()

while True:
    m = input()
    if m == "END_OF_TEXT":
        break
    else:
        m = list(m.split())
        for i in m:
            i = i.lower()
            if n == i:
                
                counter += 1
            else:
                pass

print(counter)

Submission status: Accepted

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

cnt = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
    words = line.lower().split()

    cnt += words.count(W)

print(cnt)

Submission status: Accepted

Solution code:
import sys
W = input()
anw = 0

for line in sys.stdin.readlines():
    for _ in line.split():
        if _.lower() == W:
            anw += 1
print(anw)

Submission status: Accepted

Solution code:
W=input()
ans=0
while True:
    l=input()
    if l=='END_OF_TEXT':
        break
    else:
        for elem in l.split():
            if str.lower(elem)==W:
                ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import pysnooper
import os,re,sys,operator,math,heapq,string
#from collections import Counter,deque
#from operator import itemgetter
#from itertools import accumulate,combinations,groupby,combinations_with_replacement
from sys import stdin,setrecursionlimit
#from copy import deepcopy

setrecursionlimit(10**6)
input=stdin.readline

s=input().rstrip()
ans=0
while 1:
    t=input().rstrip().split()
    if t[0]=="END_OF_TEXT":
        break
    for i in t:
        if s==i.lower():
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
def foo(S,W):
    kosu=0
    S = S.lower()
    S = S.split()
    for i in range(len(S)):
        if S[i] == W:
            kosu+=1
    return kosu

x=0
W=input()
S=input()
while S != "END_OF_TEXT":
    x += foo(S,W)
    S = input()

print(x)

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
word = input()

count = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    list = line.lower().split()
    for i in list:
        if i == word:
            count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
a = sys.stdin.read().lower().split()
print(a[1:-1].count(a[0]))

Submission status: Accepted

Solution code:
def foo(S,W):
    kosu=0
    S = S.lower()
    S = S.split()
    for i in range(len(S)):
        if S[i] == W:
            kosu+=1
    return kosu

x=0
W=input()
S=input()
while S != "END_OF_TEXT":
    x += foo(S,W)
    S = input()

print(x)

Submission status: Accepted

Solution code:
T=""
Fword = input().lower()
while True:
    s = input()
    if s == "END_OF_TEXT":
        break
    T += s.lower()
    T += " "

#print(T)
list = T.split()
#print(list)

sum=0
for word in list:
    if word == Fword:
        sum+=1

print(sum)

Submission status: Accepted

Solution code:
def test():

	W = input()
	counter = 0

	while True:

		tmp_T = input()
		if tmp_T == "END_OF_TEXT":
			break

		T = tmp_T.split()

		for word in T:
			if word.upper() == W.upper():
				counter += 1

	print(counter)


if __name__ == "__main__":
	test()

Submission status: Accepted

Solution code:
#coding: utf-8

s = 0
w = input()
while True:
    t = input()
    if 'END_OF_TEXT' in t:
        break
    t = t.lower()
    wl = list(map(str, t.split()))
    s += wl.count(w)
print(s)

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 i == w:
            count += 1

print(count)

Submission status: Accepted

Solution code:
w = input().lower()
text = ""

while True:
  temp = input()
  if temp == "END_OF_TEXT":
    break
  else:
    text += temp + " "

print(text.lower().split(" ").count(w))

Submission status: Accepted

Solution code:
W = input().lower()
T = []
while 1:
    text = input()
    if text == 'END_OF_TEXT':
        break
    else:
        T += text.lower().split()

print(T.count(W))

Submission status: Accepted

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

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:
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:
def Word(a):
    res = ""
    for c in a:
        if(ord('A') <= ord(c) <= ord('Z')):
            res += chr(ord(c) - ord('A') + ord('a'))
        else:
            res += c
    return res
 
w = Word(input())
ans = 0
 
while True:
    s = input()
    if s == "END_OF_TEXT":
        break
 
    s = list(map(str, s.split()))
    for x in s:
        if Word(x) == w:
            ans += 1
 
print(ans)

Submission status: Accepted

Solution code:
lq = []
lw = []
key = str(input()).lower()
while True:
    s = list(map(str, input().split()))
    if s[0] == "END_OF_TEXT":
        break
    lq.append(s)
for i in range(len(lq)):
    lw = lw + lq[i]
r = 0
for i in range(len(lw)):
    if lw[i].lower() == key:
        r = r + 1
print(r)

Submission status: Accepted

Solution code:
import sys

W = input()
S = sys.stdin.readlines()
count = 0
for l in S:
	for w in l.strip().split(" "):
		count += (W == w.lower())
print(count)