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:
def count(word, text):
    """Count the word in text.
    Counting is done case-insensitively.

    >>> count('a', 'A b c a')
    2
    >>> count('computer', 'Nurtures computer scientists' \
              + ' and highly-skilled computer engineers' \
              + ' who will create and exploit "knowledge"' \
              + ' for the new era. Provides an outstanding' \
              + ' computer environment.')
    3
    """
    return (text
            .lower()
            .split()
            .count(word.lower()))


def run():
    word = input()
    text = ""

    line = input()
    while line != "END_OF_TEXT":
        text += line + "\n"
        line = input()

    print(count(word, text))


if __name__ == "__main__":
    run()

Submission status: Accepted

Solution code:
word = input()
text = []
count = 0

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

print(count)

Submission status: Accepted

Solution code:
t = input().lower()
cnt = 0
while True:
    w = input()
    if w == 'END_OF_TEXT': break
    cnt += len(list(filter(lambda x: x == t, [v.lower() for v in w.split(' ')])))
print(cnt)

Submission status: Accepted

Solution code:
#coding: utf-8


w = input()
w = w.upper()
s = []
c = 0
while True:
    i = input()
    if i == "END_OF_TEXT":
        break
    s.append(i.upper())

for i in s:
    for j in i.split(" "):
        if j == w:
            c += 1

print(c)

Submission status: Accepted

Solution code:
w = input().lower()
cnt = 0
while 1:
  l = input().split()
  if "END_OF_TEXT" in l: break
  for e in l:
    if e.lower() == w: cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys

W = sys.stdin.readline().strip()
num = 0

while True:
    T = sys.stdin.readline().strip()
    if T == 'END_OF_TEXT':
        break
    t = T.lower()
    T_line = t.split()
    for i in T_line:
        if W == i:
            num += 1

print(num)

Submission status: Accepted

Solution code:
import sys

l = []
for i in sys.stdin:
    l.append(i.split())

count = 0
for i in range(1,len(l)-1):
    for j in range(0,len(l[i])):
        l[i][j] = l[i][j].lower()
    count += l[i].count(l[0][0])

print(count)

Submission status: Accepted

Solution code:
string=[]
W = input()#単語入力
while True:
    T = input()#入力
    if T == 'END_OF_TEXT':#EOT入力のときループぬける
        break
    string.append(T)#list追加
count=0
for i in range(len(string)):
    string[i]=string[i].lower()
    string[i] = string[i].split(" ")
    for j in range(len(string[i])):
        if W == string[i][j]:
            count+=1
print(count)

Submission status: Accepted

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

count = 0

while True:
    w = input()
    if w == 'END_OF_TEXT':
        break
    for x in w.lower().split(' '):
        if taisho == x:
            count += 1

print(count)

Submission status: Accepted

Solution code:
w = input().lower()
cnt = 0
while True:
	l = input()
	if l == 'END_OF_TEXT':
		break
	for e in l.split():
		cnt += e.lower() == w
print(cnt)

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().upper()
T = []
while True:
    t = input()
    if t == "END_OF_TEXT":
        break
    T += [x.upper() for x in t.split()]
print(T.count(W))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

w = sys.stdin.readline().strip()
count = 0

while True:
    t = list(map(str, input().split()))

    if 'END_OF_TEXT' in t:
        break

    for i in range(len(t)):
        if t[i].lower() == w:
            count += 1

print(count)

Submission status: Accepted

Solution code:
def make_text():
    temp = []
    while True:
        row = input().split()
        if row == ['END_OF_TEXT']:
            break
        temp.append(list(map(lambda x: x.lower(), row)))
    return temp

def find_word(word,text):
    num = 0
    for row in text:
        for t in row:
            if t == word:
                num += 1

    return num

if __name__ == '__main__':
    w = input()
    t = make_text()
    num = find_word(w,t)
    print(num)

Submission status: Accepted

Solution code:
def upper(word):
    Word = ''
    str = list(word)
    for i in range(len(str)):
        if str[i].islower(): Word += str[i].upper()
        else: Word += str[i]
    return Word

key_word = str(upper(input()))
sen = []
count = 0
while True:
    a = str(input())
    if a == 'END_OF_TEXT': break
    a = upper(a)
    sen.extend(a.split())
for i in range(len(sen)):
    if sen[i] == key_word:
        count+= 1
print(count)

Submission status: Accepted

Solution code:
#! python3
# finding_a_word.py

W = input()
sents = []
while True:
    sent = input()
    if sent == 'END_OF_TEXT' :break
    sents.append(sent.lower())

word_ct = 0
for sent in sents:
    for word in sent.split(' '):
        word = word.strip('\.\,\:\"\'')
        if word == W:
            word_ct += 1

print(word_ct)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w=input()
a=0
while True:
    t=input().split()
    l=[]
    for T in t:
        l.append(T.lower())
    a+=l.count(w)
    if t[0]=="END_OF_TEXT":
        break

print(a)

Submission status: Accepted

Solution code:
W = input().lower()
ans = 0
while True:
    s = input()

    if s == "END_OF_TEXT":
        break

    s = s.lower().split()

    ans += s.count(W)

print(ans)

Submission status: Accepted

Solution code:
w0 = raw_input().lower()
c = 0
while True:
    s = raw_input()
    if s == 'END_OF_TEXT': break
    for w in s.lower().split():
        if w == w0:
            c += 1
print c

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:
target = input()
result = 0
while True:
    sen = input()
    if sen == "END_OF_TEXT": break
    result += [i.lower() for i in sen.split()].count(target)
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fileinput
W = input()
cnt = 0
for T in fileinput.input():
    if T.rstrip() =='END_OF_TEXT':
        break

    T = T.lower().split()
    cnt += T.count(W)
    # print(T, cnt)
print(cnt)

Submission status: Accepted

Solution code:
# AOJ ITP1_9_A

def numinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a

# ※大文字と小文字を区別しないので注意！！！！
# 全部大文字にしちゃえ。
def main():
    W = input().upper()  # 大文字にする
    line = ""
    count = 0
    while True:
        line = input().split(" ")
        if line[0] == "END_OF_TEXT": break
        for i in range(len(line)):
            word = line[i].upper()
            if W == word: count += 1
    print(count)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# AOJ ITP1_9_A

# ※大文字と小文字を区別しないので注意！！！！
# 全部大文字にしちゃえ。
def main():
    W = input().upper()  # 大文字にする
    line = ""
    count = 0
    while True:
        line = input().split(" ")
        if line[0] == "END_OF_TEXT": break
        for i in range(len(line)):
            word = line[i].upper()
            if W == word: count += 1
    print(count)

if __name__ == "__main__":
    main()

# Accepted.

Submission status: Accepted

Solution code:
a,s=0,input().lower()
while(True):
  t = input().split()
  if t[0] == "END_OF_TEXT":
    print(a)
    quit()
  for i in t:
    if i.lower() == s:
      a += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fileinput

cnt = 0
W = input()
for line in fileinput.input():
    if line.rstrip() == "END_OF_TEXT":
        break

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

print(cnt)

Submission status: Accepted

Solution code:
w = str(input()).lower()
ans = 0

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input()
lis = []
cot = 0
while True:
    x = input().split()
    if x == ["END_OF_TEXT"]:
        break
    lis += x
for y in lis:
    if y.lower() == W:
        cot += 1
print(str(cot))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Finding a Word
import re

word = input()
text = ""

end = 0
while end == 0:
    input_line = input()
    if input_line == 'END_OF_TEXT':
        end += 1
    else:
        text += input_line
        text += " "

blocked = text.lower().split() # この方法では記号を取り除けないという問題がある
count = 0
for a in blocked:
    if a == word:
        count += 1
print(count)

Submission status: Accepted

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

t = []
while 1 :
    _t = input().strip().split(" ")
    if "END_OF_TEXT" in _t :
        break
    t.extend(_t)

print( sum([ i.lower()==w for i in t ] ) )

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while True:
    T = raw_input()
    if T == "END_OF_TEXT":
        break
    Ti = T.lower().split()
    for i in Ti:
        if i == W:
            c += 1

print("%d" % (c, ))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

p = 0
s = 0
for line in sys.stdin:
    ls = line.strip('\n')
    if ls == 'END_OF_TEXT': break
    ls = ls.lower()
    if p == 0:
        w = ls
        p = 1
    else:
        for word in ls.split():
            if word == w: s += 1
print s

Submission status: Accepted

Solution code:
w0 = raw_input().lower()
c = 0
while True:
    s = raw_input()
    if s == 'END_OF_TEXT': break
    for w in s.lower().split():
        if w == w0:
            c += 1
print c

Submission status: Accepted

Solution code:
W=raw_input()
T=[]
while 1:
    x=raw_input()
    if x=="END_OF_TEXT": break
    T+=[v.lower() for v in x.split()]
print T.count(W)

Submission status: Accepted

Solution code:
w=raw_input().lower()
c=0
while 1:
        t=map(str,raw_input().split())
        if t[0]=="END_OF_TEXT":
                break
        for i in range(len(t)):
                if t[i].lower()==w:
                        c+=1
print c

Submission status: Accepted

Solution code:
from __future__ import division, print_function
from sys import stdin
word = stdin.readline().rstrip().lower()
cnt = 0
for line in stdin:
    if line.startswith('END_OF_TEXT'):
        break
    cnt += line.lower().split().count(word)
print(cnt)

Submission status: Accepted

Solution code:
ans=[]
W=raw_input()
while True:
    i = raw_input()
    if i == 'END_OF_TEXT': break
    ans+=[j.lower() for j in i.split()]
print ans.count(W)

Submission status: Accepted

Solution code:
import sys
w = raw_input()
n = 0
for t in sys.stdin.read().split():
	if t == 'END_OF_TEXT':
		break
	if t.lower() == w.lower():
		n += 1
print n

Submission status: Accepted

Solution code:
import sys
w = raw_input()
n = 0
for t in sys.stdin.read().split():
    if t == 'END_OF_TEXT':
        break
    if t.lower() == w.lower():
        n += 1
print n

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = raw_input().lower()
sum = 0
while True:
    t = raw_input().split()
    if t[0] == "END_OF_TEXT":
        break
    else:
        for ti in t:
            if ti.lower() == w:
                sum += 1
print sum

Submission status: Accepted

Solution code:
W = raw_input().upper()
T = []
while True:
	txt = raw_input()
	if txt == "END_OF_TEXT":
		break
	T += txt.upper().split()
print T.count(W)

Submission status: Accepted

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

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().lower()
list=[]
while True:
    s=input()
    if s=="END_OF_TEXT":
        break
    c=s.lower().split().count(w)
    list.append(c)
print(sum(list))

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
kaito = int(0)
line = []
sagasu = str(input().upper())
#tukau = str(sagasu).upper()
while True:
    sonogyo = str(input())
    if sonogyo == "END_OF_TEXT":
        break
    line += sonogyo.upper().split( )
for a in line:
    if a == sagasu:
        kaito = kaito + 1
print(int(kaito))

Submission status: Accepted

Solution code:
W=input()
T=""
while True:
    tmp=input()
    if tmp=="END_OF_TEXT":
        break
    else:
        T+=tmp+" "

T=list(T.lower().split())
cnt=0
for word in T:
    if word==W:
        cnt+=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k=0
n=input()
n=n.lower()
s=input()
while s!='END_OF_TEXT':
    s=s.lower()
    S=s.split()
    #print(S)
    for i in range(len(S)):
        if n==S[i]:
            k+=1
    s=input()
print(k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=0
W=str(input())

while True:
    t=str(input())
    if t=='END_OF_TEXT':
        break
    t=(t.lower().split())
    a=(t.count(W))
    A=A+a
print(A)

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)
print(a)

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:
W=input()
num=0
while True:
    T=input()
    t=str.lower(T)
    if (T == 'END_OF_TEXT'):break
    t_split=(t.split())
    for i in range(len(t_split)):
        if t_split[i] == W:
            num+=1

print(num)

Submission status: Accepted

Solution code:
W=input()
sentences=''
while True:
    try:
        sentence=input()
        sentences+=sentence
        if sentence=='END_OF_TEXT':
            break
        sentences+='\n'
    except EOFError:
        pass
answer_count=0
for l in sentences.split():
    if l.lower()==W:
        answer_count+=1
print(answer_count)

Submission status: Accepted

Solution code:
from sys import stdin
w = str(input()).lower()
t = stdin.read().split()
counter = 0
for i in t:
	i = i.lower()
	if i == w:
		counter += 1
print(counter)

Submission status: Accepted

Solution code:
import sys

w=input()

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

Submission status: Accepted

Solution code:
a = []
text = input()
while True:
    b = input()
    if b == "END_OF_TEXT":
        break
    a += b.lower().split()
    
print(a.count(text))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w=input().lower()
list=[]
while True:
    s=input()
    if s=="END_OF_TEXT":
        break
    c=s.lower().split().count(w)
    list.append(c)
print(sum(list))

Submission status: Accepted

Solution code:
x = input().casefold()
count = 0
while True:
    y = input()
    if y == "END_OF_TEXT":
        break
    y = y.casefold()
    z = y.split()
    count += z.count(x)
    
print(count)

Submission status: Accepted

Solution code:
w=str(input())
t=list(input().split())
while True:
    try:
        a=str(input())
        if a!=("END_OF_TEXT"):
            a=a.split()
            t=a+t
    except EOFError:
        break
count=0
for i in range(len(t)):
    t[i]=t[i].lower()
    if t[i]==w:
        count +=1
print(count)

Submission status: Accepted

Solution code:
w=input()
list=[]
c=0
while True:
    t=input()
    if t=='END_OF_TEXT':
        break
    else:
        t=t.lower()
        
        list=t.split()
        
        for i in range(len(list)):
            if list[i]==w:
                c=c+1
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = input()
count = 0
while True:
    text = input()
    if text == "END_OF_TEXT":
        break
    text_list = text.lower().split()
    count += text_list.count(word)
print(count)

Submission status: Accepted

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

while True:
  
  text = input()

  if text == "END_OF_TEXT":
    break
  cnt += text.lower().split().count(W)

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

for i in t:
  if i == w:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
  
import sys

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


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:
import sys
W = input()
word = []
counter = 0
while 1:
    line = input()
    
    if line == "END_OF_TEXT" :
        for i in  word:
            counter += i.count( W )
        print(counter)
        sys.exit()
    line = line .lower()
    word.append( line.split() )

Submission status: Accepted

Solution code:
#57単語の検索
W=str(input())
w=str.upper(W)
c=[]
while True:
    T=str(input())
    t=str.upper(T)
    s=t.split()
    if T==('END_OF_TEXT'):
        break
    a=s.count(w)
    c.append(a)
print(sum(c))

Submission status: Accepted

Solution code:
A=0
W=str(input())

while True:
    t=str(input())
    if t=='END_OF_TEXT':
        break
    t=(t.lower().split())
    a=(t.count(W))
    A=A+a
print(A)

Submission status: Accepted

Solution code:
W = input()
number = 0
while True:
    s = input()
    if s == "END_OF_TEXT":
        break
    for ss in list(s.split()):
        if ss.lower() == W:
            number += 1

print(number)

Submission status: Accepted

Solution code:
#
# 9a
#

def main():
    W = input().lower()
    T = []
    while True:
        t = input()
        if t == "END_OF_TEXT":
            break
        T += list(t.lower().split())

    ret = 0
    for i in range(len(T)):
        if T[i] == W:
            ret += 1
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A=0
W=str(input())

while True:
    t=str(input())
    if t=='END_OF_TEXT':
        break
    t=(t.lower().split())
    a=(t.count(W))
    A=A+a
    
print(A)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
W=input()
c=0

while True:
    t=input()
    
    if t=="END_OF_TEXT":
        break
    else:
        T=t.lower()
        T=T.split()
        
        for i in range(len(T)):
            if T[i]==W:
                c+=1
print(c)

Submission status: Accepted

Solution code:
w = input().upper()
ans = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
    for word in line.upper().split():
        if word == w:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
w=input()
w2=w.lower()
y=0
while True:
    x=input()
    z=x.lower()
    s="END_OF_TEXT"
    if x == s:
        break
    m = z.split()
    a = m.count(w2)
    y += a
print(y)

Submission status: Accepted

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

while True:
    t = input().split()
    if t[0] == "END_OF_TEXT":
        break
    for i in range(len(t)):
        T.append(t[i].lower())

k = 0
for i in range(len(T)):
    if T[i] == W:
        k += 1

print(k)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=input()
l=0
while True:
    k=input()
    if k==('END_OF_TEXT'):
        break
    k1=k.lower()
    a=k1.split()
    l+=(a.count(x))
print(l)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
my_list=[]
count=0
w=input()
w=w.lower()
while(True):
    var=input()
    if(var=="END_OF_TEXT"):
        break
    else:
        var=var.split()
        my_list+=var
for t in my_list:
    t=t.lower()
    if(w == t):
        count+=1
    else:
        None
print(count)

Submission status: Accepted

Solution code:
W = input()
Wcount = 0

while True:
    tmp = input()
    T = tmp.lower().split()

    for i in T :
        if (i == W):
            Wcount += 1

        else :
            continue

    # print(letterarray)

    if(tmp == "END_OF_TEXT"):
        break

print(Wcount)

Submission status: Accepted

Solution code:
list1 = 0
key = input().lower()

while True:
    strings = input()
    if strings == "END_OF_TEXT": break
    list1 += strings.lower().split(" ").count(key)
print(list1)

Submission status: Accepted

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

s=0
while True:
    a= input()
    if a=='END_OF_TEXT' : break
    
    a=a.casefold()
    aa=a.split()
    s+= aa.count(word)
    
print(s)

Submission status: Accepted

Solution code:
import sys 
import collections as co
S=input()
ans=0
N=sys.stdin.read()
P=N.lower().split()
print(P.count(S))

Submission status: Accepted

Solution code:
w = input()

t = []
while True:
    buf = input().split()
    if buf[-1] == "END_OF_TEXT":
        break
    t += [x.lower() for x in buf]

print(t.count(w))

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()
w=w.upper()
word=[]
count=0
while True:
  t=input()
  if t=="END_OF_TEXT":
    break
  word=t.split()
  for buff in word:
    buff=buff.upper()
    if buff==w:
      count+=1

print(count)

Submission status: Accepted

Solution code:
import sys

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


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:
searching_word = input()
sentence = []
counter = 0
try:
  while True:
    words = input().lower().split()
    if words == 'end_of_text':
      break
    for i in range(len(words)):
      sentence.append(words[i])
except EOFError:
  pass

for i in range(len(sentence)):
  if sentence[i] == searching_word:
    counter += 1
print(counter)

Submission status: Accepted

Solution code:
import sys
import os


word = input().strip().lower()
c = 0
for s in sys.stdin:
    s = s.lower()
    for separated in s.split():
        if word == separated:
            c += 1
print(c)

Submission status: Accepted

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

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:
A=0
W=str(input())

while True:
    t=str(input())
    if t=='END_OF_TEXT' :break
    
    t=(t.lower().split())
    a=(t.count(W))
    
    A=A+a

print(A)

Submission status: Accepted

Solution code:
w, count = input(), 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()
a=a.lower()
d=""
for i in range(1000):
    B=input()
    if B == "END_OF_TEXT":
        break
    B=B.lower()
    d=d+" "+B
    dd=d.split()
c=dd.count(a)
print(c)

Submission status: Accepted

Solution code:
w=str(input()).upper()
v=[]
while True:
    t=str(input())
    if t == "END_OF_TEXT":
        break
    v+=t.upper().split()
s=0
for i in v:
    if i == w:
        s+=1
print("%d"%(s))

Submission status: Accepted

Solution code:
t=str(input()).upper()
line=[]
con=0

while True:
    tmp_line=str(input())
    if tmp_line=='END_OF_TEXT':
        break
    line+=tmp_line.upper().split()
    
for tmp_word in line:
    if tmp_word==t:
        con+=1
        
print(con)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while True:
  s=input()

  if s=="END_OF_TEXT":
    break

  s=s.upper().split()
  ans+=s.count(w)

print(ans)

Submission status: Accepted

Solution code:
W = input()
S = []
while True:
    s = list(map(str, input().split()))
    if s[0] == 'END_OF_TEXT':
        break
    S += s
for i in range(len(S)):
    S[i] = S[i].lower()
print(S.count(W))

Submission status: Accepted

Solution code:
a=input().lower()
b=[]
ans=0
while True:
    tmp=input()
    if tmp=="END_OF_TEXT":
        break
    b.append(tmp.lower().split(" "))
for i in b:
    for j in i:
        if j == a:
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
word = input()

sents = ""

while True:
    sent = input()
    if sent == "END_OF_TEXT":
        break
    sents = sents + " " + sent

words = list(map(str, sents.split()))
counts = 0

for w in words:
    w = w.lower()
    if w[len(w) - 1] == ".":
        w = w[:-1]
    if w == word:
        counts += 1

print(counts)