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:
#coding:utf-8
#1_9_A 2015.4.12
w = input().lower()
c = 0
while True:
    t = input().split()
    if 'END_OF_TEXT' in t:
        break
    for word in t:
        if w == word.lower():
            c += 1
print(c)

Submission status: Accepted

Solution code:
#coding:utf-8
#1_9_A 2015.4.12
w = input().lower()
c = 0
while True:
    t = input()
    if 'END_OF_TEXT' in t:
        break
    c += t.lower().split().count(w)
print(c)

Submission status: Accepted

Solution code:
c = 0
result = 0
while True:
    st = raw_input()
    if c == 0:
        s_str = st
    elif 'END_OF_TEXT' == st:
        break
    elif c > 0:
        if s_str.lower() in st.lower():
            result = result + st.lower().split(' ').count(s_str.lower())
        else:
            pass
    c = c+1
print result

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

w = sys.stdin.readline().rstrip().lower()
cnt = 0
while True:
    lines = sys.stdin.readline().rstrip()
    if not lines:
		break	
    words = lines.split( " " )
    for i in range( len( words ) ):
    	if w == words[i].lower():    		
			cnt += 1			
print( cnt )

Submission status: Accepted

Solution code:
import sys

w = sys.stdin.readline().rstrip().lower()
cnt = 0
while True:
    lines = sys.stdin.readline().rstrip()
    if not lines:
		break	
    words = lines.split( " " )
    for i in range( len( words ) ):
    	if w == words[i].lower():
			cnt = cnt + 1	

print( cnt )

Submission status: Accepted

Solution code:
import sys

w = sys.stdin.readline().rstrip().lower()
cnt = 0
while True:
	lines = sys.stdin.readline().rstrip()
	if not lines:
		break
	words = lines.split( " " )
	for i in range( len( words ) ):
		if w == words[i].lower():
			cnt = cnt + 1	

print( cnt )

Submission status: Accepted

Solution code:
import sys

w = sys.stdin.readline().rstrip().lower()
cnt = 0
while True:
	lines = sys.stdin.readline().rstrip()
	if not lines:
		break
	for s in lines.split( " " ):
		if w == s.lower():
			cnt = cnt + 1	

print( cnt )

Submission status: Accepted

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

Submission status: Accepted

Solution code:
target = raw_input()
count = 0
while True:
    line = raw_input()
    if  line == 'END_OF_TEXT':
        break
    if line[-1] == '.':
        line = line[:-1]
    for word in line.lower().split():
        if target == word:
            count += 1
print count

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w=raw_input().lower()
sum=0
while 1:
    s=raw_input()
    if s=="END_OF_TEXT": break
    a=map(str, s.lower().split())
    sum+=a.count(w)
print sum

Submission status: Accepted

Solution code:
w=raw_input().lower()
l=[]
while 1:
    s=raw_input()
    if s=="END_OF_TEXT": break
    l+=s.lower().split()
print l.count(w)

Submission status: Accepted

Solution code:
w = str.lower(raw_input())
t = []
while True:
  line = raw_input()
  if line == "END_OF_TEXT":
    break
  else:
    t += (map(str.lower, line.split(" ")))

count = 0
for i in xrange(len(t)):
  if w == t[i]:
    count += 1

print count

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = raw_input().lower()
doc = []
while True:
    tmp = raw_input()
    if tmp == 'END_OF_TEXT':
        break
    doc.extend(tmp.lower().split())
print doc.count(W)

Submission status: Accepted

Solution code:

while True :
	count_1 = 0
	w = raw_input()
	while True :
		t = raw_input()
		if t=='END_OF_TEXT':
			break
		else :
			a_list = t.lower().split()
	 		for i in a_list:
				if (w==i):
					count_1 += 1
	print(count_1)
	if t=='END_OF_TEXT':
		break

Submission status: Accepted

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

cnt = 0

while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    line = line.casefold()
    words = line.split()
    cnt += words.count(W)
    
print(cnt)

Submission status: Accepted

Solution code:
word = raw_input()
words = []
count = 0
while True:
    in_line = raw_input().split()
    words += in_line
    if words[len(words)-1] == 'END_OF_TEXT':
        break
for w in words:
    if w.lower() == word:
        count += 1
print count

Submission status: Accepted

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

Submission status: Accepted

Solution code:
findstr = raw_input().strip()
findstr = findstr.lower()
inlist = []
while True:
    tmplist = (raw_input().replace("\r"," ")).split()
    # print tmplist
    if tmplist[0] == "END_OF_TEXT":
        break
    inlist.extend(tmplist)
count = 0
for i in xrange(len(inlist)):
    if inlist[i].lower() == findstr.lower():
        count+=1
print count

Submission status: Accepted

Solution code:
# coding: utf-8

# ????´¢????±? W
target_word = input()
# ??????
words = []
while (1):
    input_text = input().strip()
    if (input_text == 'END_OF_TEXT'):
        break
    words.extend(input_text.split())

counter = 0
for w in words:
    if (w.lower() == target_word.lower()):
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
W = raw_input()

S = []

while True:
    tmp = map(str, raw_input().split())
    if tmp[0] == "END_OF_TEXT":
        break
    else:
        S.append(tmp)

cnt = 0
for i in range(len(S)):
    for j in range(len(S[i])):
        if W == S[i][j].lower():
            cnt += 1

print cnt

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
w= input().casefold()
 
cnt = 0
 
while(1):
    snt = input()
    if snt == "END_OF_TEXT":
        break
    sntt = snt.casefold()
    words = sntt.split()
    cnt += words.count(w)
     
print(cnt)

Submission status: Accepted

Solution code:
t = []
w = input()
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    for word in line.lower().split():
        t.append(word)
print(t.count(w))

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:
import sys

printf = sys.stdout.write

word = []
new_word = []
for line in sys.stdin:
    word.append((line.strip("\n")).lower())
 
for i in range(len(word)):
    new_word.append(word[i].split(" "))

ans = 0
for i in range(len(new_word)):
    for j in range(len(new_word[i])):
        if new_word[i][j].count(new_word[0][0]) > 0:
            if len(new_word[i][j]) == len(new_word[0][0]):
                ans += new_word[i][j].count(new_word[0][0])


print ans - 1

Submission status: Accepted

Solution code:
w = input().casefold()
word_count = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    line = line.casefold()
    word = line.split()
    word_count += word.count(w)
print(word_count)

Submission status: Accepted

Solution code:

w = input().casefold()
word_count = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    line = line.casefold()
    word = line.split()
    word_count += word.count(w)
print(word_count)

Submission status: Accepted

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

import sys

word = str(raw_input())
count = 0;

while True:
    line = map(str, raw_input().split())
    for i in line:
        if i == "END_OF_TEXT":
            print count
            sys.exit()
        if i.lower() == word:
            count += 1

Submission status: Accepted

Solution code:
w = raw_input().upper()
s = 0
while True:
    t = raw_input()
    if t !=  "END_OF_TEXT":
        for i in t.split() :
            if w == i.upper():
                s += 1
    else :
        break

print s

Submission status: Accepted

Solution code:
word = input().lower()
number = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
    line = line.replace('.', ' ').replace("'", " ").replace('"', ' ').replace('?',' ').replace('!', ' ').replace(',',' ')
    wordlist = list(line.lower().split())
    number += wordlist.count(word)
print(number)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = raw_input().lower()
s = 0
while True:
    b = raw_input()
    if b == 'END_OF_TEXT':
        break
    b = b.split()
    b = map(str.lower,b)
    s += b.count(a)
print s

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = raw_input().lower()
s = 0

while 1:

    in_str = raw_input()
    if in_str == "END_OF_TEXT":
        break

    in_str = map(str, in_str.split())

    for i in in_str:
        if i.lower() == w:
            s+=1

print s

Submission status: Accepted

Solution code:
w = input().lower()
t = ''
while(True):
    row = input()
    if row == 'END_OF_TEXT':
        break
    t += row.lower() + '\n'

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#   1???????????? W ??¨?????? T ,T ??????????????? W ?????°???????????????????????°??????
import sys
#   ??????W?????????
w = input()
#   ??????T?????????
t = []
#   ??????T?????????
while 1:
    temp = input()
    if temp == "END_OF_TEXT":
        break
    t += temp.strip(".")
    t += " "
#   ??????????????????
t = "".join(t).split()
#   print(t)
#   ??????T???????????¨????????????W????????????????????????
count = 0
for i in range(len(t)):
    if t[i].lower() == w:
        count += 1
print(count)

Submission status: Accepted

Solution code:
# 19-String-Finding_a_Word.py

# ?????????????´¢
# ??????????????? W ??¨?????? T ????????????????????????T ??????????????? W ?????°???????????????????????°?????????????????????????????????
# ?????? T ????????????????????????????????????????????§????????????????????????????????? Ti ??¨????????????
# ???????????? Ti ?????????????????? W ??¨??????????????????????????°??????????????????
# ???????????§????????¨?°???????????????\???????????????

# Constraints
# W????????????????????????10????¶????????????????
# T??????????????????????????????????????????1000????¶????????????????

# Input
# ?????????????????? W ????????????????????????
# ?¶???????????????°????????????????????£??????????????????????????????
# END_OF_TEXT ??¨??????????????????????????????????????????????????????

# Output
# ?????? W ?????°???????????????????????????

# 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
# Note

import re

count=0

w = input().lower()

while 1:
	string = input()
	if string=="END_OF_TEXT":
		break;

	string=string.lower().split()
	for i in string:
		count += w==i

print(count)

Submission status: Accepted

Solution code:
# 19-String-Finding_a_Word.py

# ?????????????´¢
# ??????????????? W ??¨?????? T ????????????????????????T ??????????????? W ?????°???????????????????????°?????????????????????????????????
# ?????? T ????????????????????????????????????????????§????????????????????????????????? Ti ??¨????????????
# ???????????? Ti ?????????????????? W ??¨??????????????????????????°??????????????????
# ???????????§????????¨?°???????????????\???????????????

# Constraints
# W????????????????????????10????¶????????????????
# T??????????????????????????????????????????1000????¶????????????????

# Input
# ?????????????????? W ????????????????????????
# ?¶???????????????°????????????????????£??????????????????????????????
# END_OF_TEXT ??¨??????????????????????????????????????????????????????

# Output
# ?????? W ?????°???????????????????????????

# 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
# Note

import re

count=0

w = input().lower()

while 1:
	string = input()
	if string=="END_OF_TEXT":
		break;

	for i in string.lower().split():
		count += w==i

print(count)

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()
count = 0
#T = input().lower()
#print(T)
#while T != 'END_OF_TEXT':
while True:
    T = input()
    if T == 'END_OF_TEXT':
        break

    for i in T.lower().split():
        if W == i:
            count += 1
    #T = input().lower()
    #print(i)

print(count)

Submission status: Accepted

Solution code:

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

print(count)

Submission status: Accepted

Solution code:
W = input().casefold()
count=0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    line = line.casefold()
    word = line.split()
    count += word.count(W)

print(count)

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
import math

def str_input():
    S = raw_input()
    if S[len(S)-1] == "\r":
        return S[:len(S)-1]
    return S

W = str_input()

cnt = 0
while 1:
    S = str_input()

    if (S == "END_OF_TEXT"):
        break

    S = S.lower().split()

    cnt += S.count(W)

print cnt

Submission status: Accepted

Solution code:
import sys

match = input().lower()

s = str()
for line in sys.stdin:
	s += line.lower()
print(s.split().count(match))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
target=raw_input()
ct=0
flag=0
while True:
	line=raw_input().split(" ")
	for i in line:
		if i.lower()==target.lower():
			ct+=1
		elif i=="END_OF_TEXT":
			print ct
			flag=1
	if flag==1:
		break

Submission status: Accepted

Solution code:
target=raw_input().lower()
ct=0
flag=0

while True:
	line=raw_input().split(" ")
	for i in line:
		if i.lower()==target:
			ct+=1
		elif i=="END_OF_TEXT":
			print ct
			flag=1
	if flag==1:
		break

Submission status: Accepted

Solution code:
W = input()

T = ""
while True:
    x = input()
    if x == "END_OF_TEXT":
        break
    T += x + " "

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

print(num)

Submission status: Accepted

Solution code:
w = input()

count = 0 # ????????????????????´?????°.
while True:
	line = input()

	if line == "END_OF_TEXT":
		break

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

print(count)

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input()

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

    for s in line.lower().split():
        if s == W:
            count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input()

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

Submission status: Accepted

Solution code:
W= input()


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

print(count)

Submission status: Accepted

Solution code:
W = input()

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

        for s in line.lower().split():
            if s == W:
                count += 1


print(count)

Submission status: Accepted

Solution code:
W = input()

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

    for  s in line.lower().split():
        if s == W:
            count += 1
            
print(count)

Submission status: Accepted

Solution code:
W = input()

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

Submission status: Accepted

Solution code:
W = input()

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

Submission status: Accepted

Solution code:
W = input()

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

    for s in line.lower().split():
        if s == W:
            count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    for s in line.lower().split():
        if s == W:
            count += 1

print(count)

Submission status: Accepted

Solution code:
w = input()

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

Submission status: Accepted

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

    for s in line.lower().split():
        if s == W:
            count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W=input().lower()
counter=0
while True:
    line=input()
    if line=="END_OF_TEXT":
        break
    else:
        for i in line.lower().split():
            if W==i:
                counter=counter+1
print(counter)

Submission status: Accepted

Solution code:
import sys

w = input()
s = []
cnt = 0

for i in sys.stdin.readlines():
    if i == 'END_OF_TEXT\n':
        break
    for j in [x.strip('.').lower() for x in i.split()]:
        s.append(j)

for i in s:
    if w == i:
        cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
w = raw_input().upper()
c = 0
while 1:
 t = raw_input()
 if t=="END_OF_TEXT": break
 c += t.upper().split().count(w)
print c

Submission status: Accepted

Solution code:
import sys

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

cnt = 0
while True:
    line = sys.stdin.readline().strip()
    if line == 'END_OF_TEXT':
        break
        
    words = line.split(' ')
    for i in words:
        if i.lower() == w:
            cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
word = input()
word_list = []
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
    line = (line.lower()).split()
    word_list.extend(line)
print(word_list.count(word))

Submission status: Accepted

Solution code:
s = input().lower()
n = 0
while True:
    q = []
    q = input().split()
    if q == ["END_OF_TEXT"]:
        break

    for i in q:
        i = i.lower()
        if s == i:
            n += 1
print(n)

Submission status: Accepted

Solution code:
s = raw_input()
s = s.lower().strip()
cnt = 0
while True:
	text = raw_input()
	if 'END_OF_TEXT' == text.strip():
		break
	text = text.lower()
	for item in text.split():
		if item == s:
			cnt += 1
print cnt

Submission status: Accepted

Solution code:
word = raw_input()
count = 0

while 1:
    line = raw_input()
    if line == "END_OF_TEXT":
        break
    for target in line.split(" "):
        if word.lower() == target.lower():
            count += 1

print(count)

Submission status: Accepted

Solution code:
W = str(raw_input().lower())

count = 0

while(1):
    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():
                count += 1
print count

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = input()
counter = 0
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.lower().split())
  counter += s.count(word)
  counter += s.count(word + '.')

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

W=input()
W=W.lower()

ct=0
while True:
    S=map(str,input().split())

    for i in S:
        if i=="END_OF_TEXT":
            print(ct)
            exit(0)
        elif i.lower()==W:
            ct=ct+1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
target_word = raw_input()
text = ''
while True:
    raw = raw_input()
    if raw == "END_OF_TEXT":
        break
    text += raw.strip('.') + ' '

ans = 0
for word in text.lower().split():
    if word == target_word:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
target_word = raw_input()
text = ''
while True:
    raw = raw_input()
    if raw == "END_OF_TEXT":
        break
    text += raw.strip('.') + ' '

# ans = 0
print(text.lower().split().count(target_word))
# for word in text.lower().split():
#     if word == target_word:
#         ans += 1
# print(ans)

Submission status: Accepted

Solution code:
target_word = raw_input()
text = ''
while True:
    raw = raw_input()
    if raw == "END_OF_TEXT":
        break
    # text += raw.strip('.') + ' '
    text += raw + ' '

# ans = 0
print(text.lower().split().count(target_word))
# for word in text.lower().split():
#     if word == target_word:
#         ans += 1
# print(ans)

Submission status: Accepted

Solution code:
word = raw_input()
text = []
while True:
    raw = raw_input()
    if raw == "END_OF_TEXT":
        break
    text += raw.lower().split()

print(text.count(word))
# print(text.lower().split().count(word))

Submission status: Accepted

Solution code:
word = raw_input()
text = []
while True:
    raw = raw_input()
    if raw == "END_OF_TEXT":
        break
    text += raw.lower().split()

print(text.count(word))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    # ??????????????\???
    word = input()
    texts = []
    while True:
        raw_input = input()
        if raw_input == 'END_OF_TEXT':
            break
        texts.append(raw_input.lower())

    # ?????????????¨??????°???????????????
    match_count = 0
    for line in texts:
        for w in line.split(' '):
            if w == word.lower():
                match_count += 1

    # ???????????????
    print(match_count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
T = ""
W = input().casefold()
while True:
    tmp = input()
    if tmp == "END_OF_TEXT":
        break
    T += tmp + " "
print(sum([1 for c in T.split() if c.casefold() == W]))

Submission status: Accepted

Solution code:
W = input().lower()
T = ""
while True:
  inp = input().strip()
  if inp == 'END_OF_TEXT':
    break
  T += inp.strip().lower()+' '


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

Submission status: Accepted

Solution code:
import sys
w=input().upper()
c=0
for s in sys.stdin:
    if "END_OF_TEXT" in s:
        break
    c += str(s).upper().split().count(w)
print(c)

Submission status: Accepted

Solution code:
s=input()
tex=[]
while 1:
	a=input()
	if a=="END_OF_TEXT":
		break
	else:
		tex.extend([x.lower() for x in a.split()])

c=0
tex

for i in tex:
	if i==s:
		c+=1

print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
k_word = input()
count = 0

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

print(count)

Submission status: Accepted

Solution code:
w=raw_input()
W=w.lower()
Text=[]
while True:
    text=raw_input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
for i in range(len(Text)):
    Text[i]=Text[i].lower()
print('%d'%Text.count(W))

Submission status: Accepted

Solution code:
w=input()
W=w.lower()
Text=[]
while True:
    text=input()
    if text=='END_OF_TEXT':
        break
    Text.extend(text.split())
for i in range(len(Text)):
    Text[i]=Text[i].lower()
print('%d'%Text.count(W))

Submission status: Accepted

Solution code:
import sys
W = input()
print(sum(line.lower().split().count(W) for line in sys.stdin.readlines()))

Submission status: Accepted

Solution code:
import sys
W = input().casefold()
print(sum(line.casefold().split().count(W) for line in sys.stdin.readlines()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
w = input().lower()
lines = sys.stdin.read()
line=lines[0:lines.find('END_OF_TEXT')].lower().split()
print(line.count(w))

Submission status: Accepted

Solution code:
word_count = 0
W = input().lower()
while True:
    try:
        T = input()
        if T == "END_OF_TEXT":
            break
    except EOFError:
        break
    for Ti in T.lower().split():
        if Ti == W:
            word_count += 1
print(word_count)

Submission status: Accepted

Solution code:
#coding:utf-8

target = input().lower()
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
T = raw_input()
wordList = []

W = raw_input()
while(W!="END_OF_TEXT"):
    wordList.extend(W.split(" "))
    W = raw_input()

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

Submission status: Accepted

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