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:
import sys
W = input().lower()
print(sys.stdin.read().rstrip('END_OF_TEXT').lower().split().count(W))

Submission status: Accepted

Solution code:
'''
ITP-1_9-A
 ?????????????´¢
??????????????? W ??¨?????? T ????????????????????????T ??????????????? W ?????°???????????????????????°?????????????????????????????????
?????? T ????????????????????????????????????????????§????????????????????????????????? Ti ??¨???????????????????????? Ti ?????????????????? W ??¨??????????????????????????°??????????????????
???????????§????????¨?°???????????????\???????????????
???Constraints
W????????????????????????10????¶????????????????
T??????????????????????????????????????????1000????¶????????????????
???Input
?????????????????? W ????????????????????????
?¶???????????????°????????????????????£??????????????????????????????END_OF_TEXT ??¨??????????????????????????????????????????????????????
???Output
?????? W ?????°???????????????????????????
'''
# inputData
checkString = input()
lineString = []
while True:
    searchString = input()
    # endCheck
    if searchString == 'END_OF_TEXT':
        break
    searchString = (searchString.lower()).split()
    lineString.extend(searchString)

# outputCheck 
print(lineString.count(checkString))

Submission status: Accepted

Solution code:
import sys
lines = [line for line in sys.stdin]
W = lines[0].strip()
print(sum([1 for line in lines[1:] for w in line.split() if w.lower() == W]))

Submission status: Accepted

Solution code:
import sys

W = input().lower()
T = sys.stdin.read().lower()

print(T.split().count(W))

Submission status: Accepted

Solution code:
import sys

#fin = open("test.txt", "r")
fin = sys.stdin

w = fin.readline()
w = w.rstrip('\n')
w = w.lower()

s = fin.read()
s = s.lower()
s = s.replace('\n', ' ')

s_list = s.split()
idx = 0
count = 0

for e in s_list:
	if w == e:
		count += 1

print(count)

Submission status: Accepted

Solution code:
#!usr/bin/env python3

import sys


def main():
    w = sys.stdin.readline().lower().strip('\n')
    s = 0

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

    print(s)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

T = []
while True:
	R = input()
	if R == "END_OF_TEXT":
		break
	R = R + " "
	T.append(R)

T = (''.join(T)).lower()
T = T.split()
print(T.count(W))

Submission status: Accepted

Solution code:
W = input()
s = ""
while True:
    a = input()
    try:
        if a == "END_OF_TEXT":
            break
        else:
            s += a.lower()
            s += " "
    except:
        break

t = s.strip(".").split(" ")
print(t.count(W))

Submission status: Accepted

Solution code:
import sys
count = 0
w = ""
w = raw_input()
while 1 :
    adding = map(str,raw_input().split())
    for i in adding:
          if i == 'END_OF_TEXT':
              print count
              sys.exit()
          if i.lower() == w:
              count += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str_search = input().upper()
int_cnt = 0
len_search = len(str_search)
while True:
    str_line = input()

    if str_line == "END_OF_TEXT":
        break
    
    str_line = str_line.upper()
    int_cnt = int_cnt + str_line.split().count(str_search)

print(str(int_cnt))

Submission status: Accepted

Solution code:
import re
W = input()
T = []
count = 0
while(1):
    line = input()
    if (line == "END_OF_TEXT"):
        break
    words = list(line.split())
    for word in words:
        T.append(word)
    
for word in T:
    matchOB = re.fullmatch(W, word.lower())
    if matchOB:
        count += 1

print(count)

Submission status: Accepted

Solution code:
import sys

w = input()
t = sys.stdin.read().lower().split()
print(t.count(w))

Submission status: Accepted

Solution code:
text = ''

key= input().lower()
while True:
    s = input()
    if s.find("END_OF_TEXT") >= 0: break
    try:
        text += s + ' '
    except:
        break

print([x.lower() for x in text.split(" ")].count(key) )

Submission status: Accepted

Solution code:
W = input().lower()
#print(W)
t=0

while(1):
	char_list = list(x for x in input().split())
	#print(char_list)
	if char_list[0] == 'END_OF_TEXT':
		break
	
	for i in range(len(char_list)):
		if W == char_list[i].lower():
			t += 1

print(t)

Submission status: Accepted

Solution code:
count = 0
s = ""
array =[]
while True:
    count += 1
    if count == 1:
        s = input()
    n = input()
    if n == "END_OF_TEXT":
        break
    array.append(n)
count = 0
for i in range(len(array)):
    for i2 in array[i].split():
        if s.upper() == i2.upper() or s.lower() == i2.lower():
            count += 1
print(count)

Submission status: Accepted

Solution code:
W = input().strip().upper()
T = []
while True:
    t = input().strip().split()
    if t[0] == 'END_OF_TEXT':
        break
    else:
        for i in t:
            T.append(i.upper())

print(T.count(W))

Submission status: Accepted

Solution code:
wor = input().upper()
cou = 0

import re
while True :
    tes = input().split()
    if tes[0] == 'END_OF_TEXT': break
    tes = [temp.upper() for temp in tes]
    cou += tes.count(wor)

print(cou)

Submission status: Accepted

Solution code:
a=raw_input().lower()
c=0
while 1:
	b=raw_input()
	if b=='END_OF_TEXT':break
	for i in b.lower().split():
		if i==a:c+=1
print c

Submission status: Accepted

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

Submission status: Accepted

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

while True:
    line = input()
    if line=='END_OF_TEXT':
        break
    else:
        text.append(line.lower().split())


for i in text:
    for j in i:
        if j == word:
            count += 1

print(str(count))

Submission status: Accepted

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

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:
key = input()
count = 0

while True:
    l = list(map(str, input().split()))
    l_lower = [ s.lower() for s in l]
    count += l_lower.count(key)
    if l[-1] == 'END_OF_TEXT':
        break

print(count)

Submission status: Accepted

Solution code:
word = input().lower()
count = 0
while 1:
    array = input().split()
    if array[0] == "END_OF_TEXT":
        break

    for a in array:
        if a.lower() == word:
            count += 1

print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !

def func():
    try:
        word=input().rstrip().lower()
        words=[]
        while(True):
            line=input().rstrip()
            if(line == "END_OF_TEXT"):
                break
            else:
                words.extend(line.lower().split(" "))
    except:
        return inputError()

    print(words.count(word))
    

def inputError():
    print("input Error")
    return -1
 
func()

Submission status: Accepted

Solution code:
W = input().lower()
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:
#!/usr/bin/env python

contents = []
counter = 0

word = input()

while True:
    text = input()
    if text == "END_OF_TEXT":
        break
    textWords = text.split()
    contents.append(textWords)

for x in contents:
    for y in x:
        if y.lower() == word:
            counter += 1

print(counter)

Submission status: Accepted

Solution code:
W=input().upper()
T=""
while True:
    Ti = input()+" "
    if Ti != "END_OF_TEXT ":
        T+= Ti.upper()
    else:
        break
TT=T.split(" ")
c=0
for t in TT:
    if t == W:
        c+=1
print(c)

Submission status: Accepted

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:
        break
print(count)

Submission status: Accepted

Solution code:
from sys import stdin

w = input()

n = 0
for line in stdin:
    line = line.rstrip()

    if 'END_OF_TEXT' == line:
        break

    n += len(list(filter(lambda x: w.lower() == x.lower(), line.split(' '))))

print(n)

Submission status: Accepted

Solution code:
W = input().lower()
T=[]
t = input()
while t != "END_OF_TEXT":
 t = t.lower().split()
 T += t
 t = input()

print(T.count(W))

Submission status: Accepted

Solution code:
W = input()
T = input()
count = 0
while T != 'END_OF_TEXT':
    T = T.lower().split()
    count += T.count(W.lower())
    T = input()
print(count)

Submission status: Accepted

Solution code:
#coding:utf-8

w = input().rstrip()

bun =[]
a =""
while a !="END_OF_TEXT":
    a = input().rstrip()
    if a =="END_OF_TEXT":
        break

    bun += a.lower().split()

print(bun.count(w))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
W = input().lower()
cnt = 0
for line in sys.stdin:
    s = line.lower()
    T = s.split(" ")
    for i in range(len(T)):
        if T[i] == "end_of_text":
            break
        if T[i].strip("\".,\n") == W:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter
W=input().lower()
count=0
while True:
    line=input().split()
    if line==["END_OF_TEXT"]:
        break
    count+=Counter(map(lambda x:x.lower(),line))[W]
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

word = input()
count = 0

while True:
    text = input()
    if text == 'END_OF_TEXT':
        break

    count += Counter(text.lower().split())[word.lower()]

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
?????????????´¢
"""
lower = "abcdefghijklmnopqrstuvwxyz"
upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

inp = input().strip()
w = inp.translate(str.maketrans(upper,lower))
s = ""
while True:
    inp = input().strip()
    if inp == "END_OF_TEXT":
        break
    s = s + " " + inp.translate(str.maketrans(upper,lower))
arr = s.split()
print(arr.count(w))

Submission status: Accepted

Solution code:
n=input()
count=0
while 1 :
    x=[i for i in input().split()]
    if x[0]=="END_OF_TEXT":
        break
    for i in range(len(x)):
        if x[i].lower()==n.lower():
            count=count+1
print(count)

Submission status: Accepted

Solution code:
w = input()
t = []
while True:
	temp = input()
	if temp == 'END_OF_TEXT':
		break
	else:
		t += [s.strip(',.') for s in temp.lower().split(' ')]

print(t.count(w))

Submission status: Accepted

Solution code:
def main():
    W = input()
    T = list(linein())

    w = W.lower()
    ans = 0
    for t in T:
        for word in t.split():
            if w == word.lower():
                ans += 1

    print(ans)

def linein():
    while True:
        try:
            s = input()
            if s == 'END_OF_TEXT':
                break
            yield ''.join(s)
        except EOFError:
            break

main()

Submission status: Accepted

Solution code:
n = 0
T=""
s= input().lower()
while True:
    t=input()
    T += t + " "
    if T.count("END_OF_TEXT")>0:
        break

TL = T.split(" ")

for i in TL:
    i = i.replace('"','')
    i= i.replace(".","")
    if i.lower() == str(s):
        n += 1
    else:
        pass
print (n)

Submission status: Accepted

Solution code:
W=input()

T=""
while True:
    line_sentence=input()
    if line_sentence=="END_OF_TEXT":
        break
    T+=" "+line_sentence.lower()

t=T.split()

cnt=0
for w in t:
    if w==W:
        cnt+=1

print(cnt)

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:
search_s = input()
cnt = 0
while True:
    s = input()
    if s == "END_OF_TEXT": break
    word_list = s.lower().split()
    for word in word_list:
        if word == search_s:cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
W = input().lower()
T = []
while True:
    S = input()
    if S == "END_OF_TEXT":
        break
    T.extend([words.lower() for words in S.split()])
print(T.count(W))

Submission status: Accepted

Solution code:
W = input()
ls = []
count = 0
while True:
    text = input()
    if text == 'END_OF_TEXT':
        break
    else:
        ls.append(list(map(str, text.split())))
for i in ls:
    for s in i:
        if s.lower() == W.lower():
            count += 1
print(count)

Submission status: Accepted

Solution code:
W = input()
ls = []
count = 0
while True:
    text = input()
    if text == 'END_OF_TEXT':
        break
    else:
        ls = list(map(str, text.split()))
    for s in ls:
        if s.lower() == W.lower():
            count += 1
print(count)

Submission status: Accepted

Solution code:
W=input()
count=0
while True:
    text=input()
    if text == 'END_OF_TEXT':
        break
    else:
        ls = list(map(str, text.split()))
    for s in ls:
        if s.lower() == W.lower():
            count += 1
print(count)

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:
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:
search = raw_input().upper()
sentence = []
while 1:
    input_data = raw_input()
    if input_data == 'END_OF_TEXT':
        break   
    sentence += [s.upper() for s in input_data.split()]

ret = 0
for word in sentence:
    ret += 1 if word == search else 0
print ret

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Aizu Problem ITP_1_9_A: Finding a Word
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input2.txt", "rt")


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

Submission status: Accepted

Solution code:
import sys
w = input()
c = 0
for line in sys.stdin:
    if line == "END_OF_TEXT\n":
        break
    T = line.lower().split()
    c += T.count(w)
print(c)

Submission status: Accepted

Solution code:
a=0
b=input()
b=b.lower()
while True:
    z=list(map(str,input().split()))
    if z==['END_OF_TEXT']:
        break
    z=[str(i).lower() for i in z ]
    a+=z.count(b)
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = input()

string = input().lower()
last = ""

while last != "END_OF_TEXT":
	last = input()
	string += " " + last.lower()

list_words = list(string.split())

count = 0

for s in list_words:
	if s == word:
		count += 1

print(count)

Submission status: Accepted

Solution code:
cnt = 0

W = input()

while True:
    T = input().split()
    if T[0] == "END_OF_TEXT":
        break
    for word in T:
        if W.lower() == word.lower():
            cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
w = input()
t = ""
while 1:
    try:
        t += input().lower()
        t += " "
    except EOFError:
        break
s = t.split()
count = 0
for i in s:
    if i == w:
        count += 1
print(count)

Submission status: Accepted

Solution code:
word = input().lower()
cnt = 0
while True:
    text = input()
    if text == "END_OF_TEXT": break
    text_list = list(text.split())
    for i in text_list:
        if i.lower() == word:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import re

def reader():
    p = re.compile("^{}$".format(input()), re.I)
    yield 0
    while True:
        s = input()
        if s == "END_OF_TEXT":
            break
        for w in s.split():
            if p.match(w):
                yield 1

print(sum(reader()))

Submission status: Accepted

Solution code:
import re
c=0
s=''
p=input().upper()
ptn=re.compile(r'^'+p+r'$')

while True:
    s=input()
    if s =='END_OF_TEXT':
        break
    a=s.upper().split()
    for i in a:
        if re.match(ptn, i):
            c+=1
print(c)

Submission status: Accepted

Solution code:
import re
c=0
p=input().upper()
ptn=re.compile(r'^'+p+r'$')

while True:
    s=input()
    if s =='END_OF_TEXT':
        break
    a=s.upper().split()
    for i in a:
        if re.match(ptn, i):
            c+=1
print(c)

Submission status: Accepted

Solution code:
import re

c=0
p=input().upper()
ptn=re.compile(r'^'+p+r'$')

while True:
    s=input()
    if s =='END_OF_TEXT':
        break
    a=s.upper().split()
    for i in a:
        if re.match(ptn, i):
            c+=1
print(c)

Submission status: Accepted

Solution code:
import re

c=0
ptn=re.compile(r'^'+input().upper()+r'$')

while True:
    s=input()
    if s =='END_OF_TEXT':
        break
    a=s.upper().split()
    for i in a:
        if re.match(ptn, i):
            c+=1
print(c)

Submission status: Accepted

Solution code:
import re

c=0
p=re.compile(r'^'+input().upper()+r'$')

while True:
    s=input()
    if s =='END_OF_TEXT':
        break
    a=s.upper().split()
    for i in a:
        if re.match(p, i):
            c+=1
print(c)

Submission status: Accepted

Solution code:
word=input().lower()
how_in=0
while True:
    letters=input()
    if letters=='END_OF_TEXT':
        break
    for i in letters.lower().split():
        if i==word:
            how_in+=1
print(how_in)

Submission status: Accepted

Solution code:
word = input().lower()
text = []
c = 0
while True:
    read = input().split()
    if read[0] == 'END_OF_TEXT':
        break
    else:
        text.append(read)
for i in text:
    for n in i:
        if word == n.lower():
            c += 1
print(c)

Submission status: Accepted

Solution code:
word = input().lower()
texts = []
while True:
  str = input()
  if str == 'END_OF_TEXT':
    break
  texts.extend([s.lower() for s in str.split()] )
    

ans = texts.count(word)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W, c = input(), 0
for line in iter(input, 'END_OF_TEXT'):
    for Ti in  line.lower().split():
        if W == Ti:
            c +=1
print(c)

Submission status: Accepted

Solution code:
word = raw_input()
counter = 0
while True:
    line = raw_input()
    if line == "END_OF_TEXT":
        break
    counter += line.lower().split(" ").count(word)

print counter

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = raw_input()

words = []
while True:
	line = raw_input()
	if line == "END_OF_TEXT":
		break
	else:
		line_list = line.split(" ")
		words += line_list
#print words

cnt = 0
for word in words:
	if w.lower() == word.lower():
		cnt += 1
print cnt

Submission status: Accepted

Solution code:
def main():

    target_word = str(input()).lower()
    texts_tuple = tuple()
    
    while True:
        text = input()
        if text == 'END_OF_TEXT': break
        texts_tuple += tuple(text.lower().split())
    
    print(texts_tuple.count(target_word))


main()

Submission status: Accepted

Solution code:
s=input().lower()
cnt=0
while True:
    l=input().split()
    if l[0]=='END_OF_TEXT': break
    for i in range(len(l)):
        lg=len(l[i])-1
        if not l[i][lg].isalpha(): l[i]=l[i][:lg]
        cnt+=(s==l[i].lower())
print(cnt)

Submission status: Accepted

Solution code:
key = input()

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

    cnt += sum([key == word for word in line.lower().split()])

print(cnt)

Submission status: Accepted

Solution code:
w = input()
a = []
while True:
    t = input()
    if t == "END_OF_TEXT":
        break
    t = t.split()
    a.append(t)
ans = list(item.lower() for innerlist in a for item in innerlist)
print(ans.count(w))

Submission status: Accepted

Solution code:
# Belongs to : midandfeed aka asilentvoice
w = str(input()).lower()
ans = 0
while(1):
	s = str(input())	
	if s == "END_OF_TEXT":
		break
	else:
		ans += sum([1 for x in s.split() if x.lower() == w])
		
print(ans)

Submission status: Accepted

Solution code:
W = input().lower()
wc = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
        
    for k in line.lower().split():
        if W == k:
            wc += 1

print(wc)

Submission status: Accepted

Solution code:
W=input().upper()
r=0
while 1:
  w=input()
  if w == 'END_OF_TEXT':break
  r+=len([x for x in w.upper().split() if x == W])
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import *
tt=input()
text=stdin.read().upper().split().count(tt.upper())
print(text)

Submission status: Accepted

Solution code:
import sys
a=input()
b=sys.stdin.read().upper().split().count(a.upper())
print(b)

Submission status: Accepted

Solution code:
import sys
a=input()
print(sys.stdin.read().upper().split().count(a.upper()))

Submission status: Accepted

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

import fileinput

def main():

    W = input().lower()

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

        for i in inputList:
            if(W == i):
                count += 1

    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    W = input().lower()
    words = []
    while True:
        T = input()
        if T == "END_OF_TEXT":
            break

        words.extend(T.split(" "))

    ans = sum(1 for word in words if word.lower() == W)

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
W=input()
T=[]
while 1:
 a=input()
 if'END_OF_TEXT'==a:break
 T+=[s.lower() for s in a.split()]
print(T.count(W))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input().lower()
c = 0
while True:
    s = input()
    if s == 'END_OF_TEXT':
        break
    s = s.split()
    for i in s:
        if x == i.lower():
            c += 1

print(c)

Submission status: Accepted

Solution code:
W = raw_input().lower()
T = []
while 1:
	try:
		T += raw_input().lower().split()
	except:
		break
print T.count(W)

Submission status: Accepted

Solution code:
W = input().lower()
words = ''
while True:
    word = input()
    if word == 'END_OF_TEXT':
        break
             
    words = words + word.lower() + " "
print(sum([1 for c in words.split() if c == W]))

Submission status: Accepted

Solution code:
W = input()

c = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    for w in line.lower().split():
        if w == W:
            c += 1
print(c)

Submission status: Accepted

Solution code:
t = []
w = input().lower()
while True:
    s = input()
    if s == "END_OF_TEXT":
        break
    t.extend(s.lower().split())
print(t.count(w))

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
# coding:utf-8
W = raw_input().lower()
array = []
cnt = 0
while True:
    line = raw_input()
    if line == "END_OF_TEXT":
        break
    split = line.lower().split()
    for s in split:
        array.append(s)
for word in array:
    if W == word:
        cnt += 1
print cnt

Submission status: Accepted

Solution code:
c = 0
hoge = ''
while True:
    sent = input()
    if sent.strip() == 'END_OF_TEXT':
        break
    if hoge:
        for word in sent.split():
            if word.lower() == hoge:
                c += 1
    else:
        hoge = sent.strip()
print (c)

Submission status: Accepted

Solution code:
word, num = input(), 0
while True:
    sentence = input()
    if sentence=="END_OF_TEXT":
        break
    word_list = sentence.lower().replace(".", " ").split()
    for i in word_list:
        if word==i:
            num += 1
print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys

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

num_w = 0

while True:
    s_lst = sys.stdin.readline().split()
    if s_lst[0] == 'END_OF_TEXT':
        break
    for str_x in s_lst:
        str_x = str_x.lower()
        if str_x == w:
            num_w += 1

print(num_w)

Submission status: Accepted

Solution code:
w = input()
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 re

def find_a_word(w, t):
    list = []
    for e in map(lambda x: re.split(r'\s|,|\.', x.lower()), t):
        list.extend(e)
    return list.count(w.lower())

if __name__ == '__main__':
    w = input()
    t = []
    while True:
        i = input()
        if i == 'END_OF_TEXT':
            break
        else:
            t.append(i)

    print(find_a_word(w, t))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


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

        if str(line).lower().split()[i] == t:
            answerCount += 1



print(answerCount)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input()
small = 'abcdefghijklmnopqrstuvwxyz'
large = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
count = 0
while True:
    text = input()
    if text == 'END_OF_TEXT':
        break
    else:
        stext = ''
        for i in text:
            j = 0
            while j < 26:
                if i == large[j]:
                    stext += small[j]
                    break
                j += 1
            if j == 26:
                stext += i
        t = list(map(str, stext.split(' ')))
        for p in t:
            if p == w:
                count += 1
print(count)