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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
taisho = input()

count = 0

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

print(count)

Submission status: Wrong Answer

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

count = 0

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

print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
keyword = input()
string = []
while True:
    tmp = input()
    if tmp == 'END_OF_TEXT':
        break
    else:
        string += tmp
print(string.count(keyword))

Submission status: Wrong Answer

Solution code:
keyword = input()
string = []
while True:
    tmp = input()
    if tmp == 'END_OF_TEXT':
        break
    else:
        string += tmp
print(''.join(string).lower().count(keyword))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys

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

while True:
    t = sys.stdin.readline().lower()

    if t == 'end_of_text':
        break

    count += t.count(w)

print(count)

Submission status: Wrong Answer

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

import sys

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

while True:
    t = sys.stdin.readline()

    if t == 'END_OF_TEXT':
        break
    else:
        t = t.lower()

    count += t.count(w)

print(count)

Submission status: Wrong Answer

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

import sys

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

while True:
    t = sys.stdin.readline()

    if 'END_OF_TEXT' in t:
        break
    else:
        t = t.lower()

    count += t.count(w)

print(count)

Submission status: Wrong Answer

Solution code:
def make_text():
    temp = []
    while True:
        row = input().split()
        if row == ['END_OF_TEXT']: #split()すると1要素でもリストとして返ってくることに注意
            break #breakするときはif文の一行書きができない
        temp.append(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: Wrong Answer

Solution code:
def make_text():
    temp = []
    while True:
        row = input().split()
        if row == ['END_OF_TEXT']:
            break
        temp.append(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: Wrong Answer

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

Submission status: Wrong Answer

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(upper(input()))
    if a == 'END_OF_TEXT': break
    sen.extend(a.split())
for i in range(len(sen)):
    if sen[i] == key_word: count+= 1
print(count)

Submission status: Wrong Answer

Solution code:
w = input().lower()
s = input()
c=0
while (s != 'END_OF_TEXT'):
	c += s.lower().count(w)
	s = input()
print(c)

Submission status: Wrong Answer

Solution code:
w = str(input())
cont = 0
while 1:
	t = str(input())
	if t == 'END_OF_TEXT':
		print(cont)
		break
	cont += t.count(w)

Submission status: Wrong Answer

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

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
target = input()
result = 0
while True:
    sen = input().lower()
    if sen == "END_OF_TEXT".lower(): break
    result += sen.split().count(target)
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import fileinput
W = input()
cnt = 0
for line in fileinput.input():
    if line.rstrip() == 'END_OF_TEXT':
        break
    line = ''.join(line.lower().split())
    print(line)
    cnt += line.count(W)
print(cnt)

Submission status: Wrong Answer

Solution code:
import fileinput
W = input()
cnt = 0
for line in fileinput.input():
    if line.rstrip() == 'END_OF_TEXT':
        break
    line = ''.join(line.split())
    print(line)
    cnt += line.count(W)
print(cnt)

Submission status: Wrong Answer

Solution code:
import fileinput
W = input()
cnt = 0
for line in fileinput.input():
    if line.rstrip() == 'END_OF_TEXT':
        break
    line = ''.join(line.lower().split())
    print(line)
    cnt += line.count(W)
print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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()
    line = ""
    count = 0
    while True:
        line = input()
        if line == "END_OF_TEXT": break
        index = -1
        while True:
            # Wが1文字の場合もあるのでindexに1を足す。
            index = line.find(W, index + 1)
            if index < 0: break
            count += 1
    print(count)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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().upper()
        if line == "END_OF_TEXT": break
        index = -1
        while True:
            # Wが1文字の場合もあるのでindexに1を足す。
            index = line.find(W, index + 1)
            if index < 0: break
            count += 1
    print(count)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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()
        if line == "END_OF_TEXT": break
        line = line.upper()  # end_of_textが来る場合に備えてあとで大文字化する。
        index = -1
        while True:
            # Wが1文字の場合もあるのでindexに1を足す。
            index = line.find(W, index + 1)
            if index < 0: break
            count += 1
    print(count)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import fileinput

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

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

print(cnt)

Submission status: Wrong Answer

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

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

	pos = 0
	idx = 0
	while True:
		pos = t[idx:].find(w)
		if pos == -1: break
		ans += 1
		idx += pos + len(w)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
W = input()
txt = ''
while 1:
    T = input()
    if T == 'END_OF_TEXT': break
    txt += ' ' + T
print(txt.count(W))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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.split(word)
print(len(blocked) - 1)

Submission status: Wrong Answer

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(word)
print(len(blocked) - 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W = input()
s = ''
while True:
    sen = str(input()) + ' ' 
    if(sen != 'END_OF_TEXT '):
        s += sen
    else:
        break
print(s.count(W))

Submission status: Wrong Answer

Solution code:
W = str(input())
while True:
    s = str(input())
    if (str(s) == 'END_OF_TEXT'):
        break
    wlist = s.lower().split()
print(wlist.count(W))

Submission status: Wrong Answer

Solution code:
W = str(input())
while True:
    s = str(input())
    if (str(s) == 'END_OF_TEXT'):
        break
    wlist = s.lower().rstrip().rstrip('.').split(' ')
print(wlist.count(W))

Submission status: Wrong Answer

Solution code:
W = raw_input()
c = 0

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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:
        s += ls.count(w)
print s

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

l=[]
ans=0
kari=0
W=raw_input()
for n in sys.stdin:
    l.append(n.split())
    print n
    if n=='END_OF_TEXT':
        break

for i in l:
    kari=i.count(W)
print ans

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
w = raw_input()

sum = 0
while True:
    t = raw_input()
    if t == "END_OF_TEXT":
        break
    elif t == w:
        sum += 1

print sum

Submission status: Wrong Answer

Solution code:
w = raw_input()

sum = 0
while True:
    t = raw_input()
    if t == "END_OF_TEXT":
        break
    else:
        sum += t.count(w)

print sum

Submission status: Wrong Answer

Solution code:
w = raw_input().lower()
sum = 0
while True:
    t = raw_input().lower()
    if t == "end_of_text":
        break
    else:
        sum += t.count(w)
print sum

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 == w:
                sum += 0
print sum

Submission status: Wrong Answer

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 += 0
print sum

Submission status: Wrong Answer

Solution code:
W = raw_input()
T = ""
while True:
	txt = raw_input()
	if txt == 'END_OF_TEXT':
		break
	T += txt.replace("\n","")
origin = len(T)
T = T.replace(W,"")
print (origin - len(T)) / len(W)

Submission status: Wrong Answer

Solution code:
W = raw_input().lower()
T = ""
while True:
	txt = raw_input()
	if txt == 'END_OF_TEXT':
		break
	T += (txt.replace("\n","")).lower()
origin = len(T)
T = T.replace(W,"")
print (origin - len(T)) / len(W)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

Solution code:
a=raw_input().lower()
c=0
while 1:
	b=raw_input().lower()
	if b.strip()=='end_of_text':break
	pos=0
	while b.find(a,pos)!=-1:
		pos=b.find(a)+1
		c+=1
print c

Submission status: Time Limit Exceeded

Solution code:
count = 0
W = input().lower()
T = [0]
while True:
    try:
        if T[0] == "END_OF_TEXT":
            break
        for t in T:
            if W == t:
                count += 1
        T = [x.lower() for x in input().split()]
    except EOFError:
        break
    except IndexError:
        pass
print(count)

Submission status: Accepted

Solution code:
def main():
    w = input()
    wards = []
    while True:
        wards.extend(ward for ward in input().split())
        if wards[-1] == 'END_OF_TEXT':
            break
    num = 0
    for ward in map(lambda ward: ward.lower(), wards):
        if ward == w:
            num += 1
    print(num)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():

    Counter = 0
    Text_W = input()
    while True:
        Text_T = input()
        if "END_OF_TEXT" in Text_T:
            temp = Text_T.lower().split()
            for i in range(len(temp)):
                Counter += 1 if Text_W == temp[i] else 0
            break
        else:
            temp = Text_T.lower().split()
            for i in range(len(temp)):
                Counter += 1 if Text_W == temp[i] else 0

    print (Counter)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from functools import reduce

def match_word(w1, w2):
    return w1 == w2 or w1+'.' == w2

def count_if(f, lst):
    count = 0

    for l in lst:
        count += 1 if f(l) else 0

    return count

def main():
    count = 0

    word = input().lower()

    while True:
        line = input();

        if line == 'END_OF_TEXT':
            break

        count += count_if(lambda w: match_word(word, w.lower()), line.split())

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def count_if(f, lst):
    count = 0

    for l in lst:
        count += 1 if f(l) else 0

    return count

def main():
    count = 0

    word = input().lower()

    while True:
        line = input();

        if line == 'END_OF_TEXT':
            break

        count += count_if(lambda w: word == w.lower(), line.split())

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
target = input()
total_text = ""
while True:
 text = input()
 if(text=="END_OF_TEXT"):
  break
 total_text+=" "
 total_text+=text
#text2 = text.replace('\n',' ')
sentenceList = total_text.split()
count = 0
for word in sentenceList:
 if(word.lower() == target):
  count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = input().lower()
text = []
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    text += line.lower().split()
print(len([x for x in text if x == word]))

Submission status: Accepted

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

Submission status: Accepted

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

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 = str(input()).lower() 

table = []
count = 0

while True:
    
    T = str(input())
    if T == "END_OF_TEXT":
        break
    else:
        T = T.lower().split()
    
    for j in range(len(T)):
        table.append(T[j])
    
    
for i in table:
    if i == W:
        count += 1
    
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import re

W = stdin.readline().rstrip()
T = stdin.read().replace("END_OF_TEXT", ".").lower()
T = re.split(",|\n| ", T)
print(len([x for x in T if x == W]))

Submission status: Accepted

Solution code:
import re
pattern = str(input())
words = []
while True:
    line = str(input())
    if line == 'END_OF_TEXT':
        break
    words += line.split()

cnt = 0
for word in words:
    if re.fullmatch(pattern, word.lower()):
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import re
pattern = str(input())
words = []
while True:
    line = str(input())
    if line == 'END_OF_TEXT':
        break
    words += line.lower().split()

cnt = 0
for word in words:
    if re.fullmatch(pattern, word):
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
W = str(input())
words = []
while True:
    line = str(input())
    if line == 'END_OF_TEXT':
        break
    words += line.lower().split()

cnt = 0
for word in words:
    if W == word:
        cnt += 1
print(cnt)

Submission status: Accepted

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

ans = 0
while True:
	line = input().rstrip()

	if line == 'END_OF_TEXT': break
	
	line = line.lower().split(' ')
	for word in line:
		if word == W: ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w=input()
ll=list()
while True:
    T=input()
    if T=="END_OF_TEXT":
        break
    T=T.lower()
    t=T.split()
    for i in t:
        ll.append(i)
ans=ll.count(w)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
key_word = input().lower()
counter = 0
while True:
    sentences = input().split()
    if sentences == ['END_OF_TEXT']:
        break
    for sent in sentences:
        if sent.lower() == key_word:
            counter += 1
print(counter)

Submission status: Accepted

Solution code:
def count_unit(ss,pp):
    count = 0
    for i in lst:
        if ss == i.lower():
            count = count + 1
    return count

s = str(input())
sum = 0
while True:
    lst = list(map(str, input().split()))
    if lst[0] == "END_OF_TEXT":
        print(sum)
        break
    else:
        sum += count_unit(s,lst)

Submission status: Accepted

Solution code:
findmoji = input()

mojilist = []
cnt = 0
while True:
	oneline = input()
	if oneline == "END_OF_TEXT":
		break
	else:
		s = oneline.split(" ")
		for m in s:
			if m.lower() == findmoji:
				cnt += 1

print(cnt)

Submission status: Accepted

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

c = 0
while True:
  L = list(str(input()).split())
  if L[0] == 'END_OF_TEXT':
    break
  for word in L:
    if word.lower() == w:
      c += 1
  
print (c)

Submission status: Accepted

Solution code:
a = input().lower()
cnt = 0
while 1:
    c = input()
    if c == 'END_OF_TEXT':
        break
    cnt += c.lower().split().count(a)
print(cnt)

Submission status: Accepted

Solution code:
#coding: UTF-8

word = input().upper()
cnt = 0

while True:
    sentence = list(map(str, input().split()))
    if 'END_OF_TEXT' in sentence:
        break
    for i in range(len(sentence)):
        if word == sentence[i].upper():
            cnt += 1

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

Ti=[]
count=0

while True:
  T=input()
  s=T.lower()
  if T=="END_OF_TEXT":
    break
  Ti += list(s.split())

  
for i in range(len(Ti)):
  if Ti[i]==W:
    count +=1

print(count)

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:
import sys
target = input()
data = sys.stdin.read()

print("%d" %(data.lower().split().count(target.lower())))

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:
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=[]
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:
key = raw_input().upper()
c = ''
while True:
    s = raw_input()
    if s == 'END_OF_TEXT':
        break
    c = c + ' ' + s.upper()
   
cs = c.split()
total = 0
for w in cs:
    if w == key:
        total = total + 1
        
print total

Submission status: Accepted

Solution code:
W = raw_input().lower()
s = []
while True:
    T = map(str, raw_input().split())
    if(T[0] == "END_OF_TEXT"):
        break
    else:
        for i in range(len(T)):
            s.append(T[i].lower())
ans = 0
for i in range(len(s)):
    if(s[i] == W):
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = raw_input().lower()
ans = 0
while True:
    T = map(str, raw_input().split())
    if(T[0] == "END_OF_TEXT"):
        break
    else:
        for i in range(len(T)):
            if(W == T[i].lower()):
                ans += 1
print(ans)

Submission status: Accepted

Solution code:
one_word = raw_input()
word_count = 0
word_list = []

while 1:
	temp = raw_input()
	word_list += temp.split()
	
	if word_list[len(word_list)-1] == "END_OF_TEXT":
		break

for word in word_list:
	if one_word.lower() == word.lower():
		word_count += 1

print word_count

Submission status: Accepted

Solution code:
w = raw_input()
t = []

while 1:
	x = raw_input()
	if x =="END_OF_TEXT":break
	t+=x.lower().split()
print t.count(w)

Submission status: Accepted

Solution code:
n=raw_input().lower()
ans=e=0
while 1:
    if e:break
    for w in raw_input().split():
        if w.lower()==n:ans+=1
        if 'END_OF_TEXT'==w:
            e=1
            break
print ans

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = raw_input().lower()
total = 0
while True:
    str_list = raw_input().split(" ")
    
    if str_list[0] == "END_OF_TEXT":
       break
    
    for s in str_list:
        if s.lower() == word:
            total += 1

print total

Submission status: Accepted

Solution code:
import sys

keyword = input().lower()
count = 0
for line in sys.stdin:
    count += sum([1 for word in line.lower().split() if word == keyword])
    
print(count)

Submission status: Accepted

Solution code:
target = input()

count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break

    for word in line.split():
        if word.lower() == target.lower():
            count += 1

print(count)

Submission status: Accepted

Solution code:
target = input()

count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break

    for word in line.split():
        if word.lower() == target.lower():
            count += 1
print(count)

Submission status: Accepted

Solution code:
w = input()
t = []
count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break

    for x in line.split():
        if w.lower() == x.lower():
            count += 1
print(count)

Submission status: Accepted

Solution code:
import sys
w = sys.stdin.readline().strip().lower()
t = sys.stdin.read().lower().split()[:-1]
print(t.count(w))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    W = input().lower()
    words = []
    while True:
        line = input()
        [words.append(i) for i in line.lower().split()]
        if 'END_OF_TEXT' in line: break
    print(words.count(W))