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 T i separated by space characters and newlines. Count the number of T i 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

Solution (Python):
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()

Solution (Python):
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()

Solution (Python):
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()

Solution (Python):
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()

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

Solution (Python):
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))

Solution (Python):
target = input()
total_text = ""
while True:
 text = input()
 if(text=="END_OF_TEXT"):
  break
 total_text+=" "
 total_text+=text

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

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

Solution (Python):
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]))

Solution (Python):
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)

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

Solution (Python):
W = input().lower()
ans = 0
while 1:
    T = input()
    if T == "END_OF_TEXT":
        break
    ans += T.lower().split().count(W)
print(ans)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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]))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):


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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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]))

Solution (Python):
import sys
target = input()
data = sys.stdin.read()

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

Solution (Python):
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))

Solution (Python):
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]))

Solution (Python):
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]))

Solution (Python):
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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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

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

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

Solution (Python):
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

Solution (Python):
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

Solution (Python):
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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):
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))

Solution (Python):


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)

Solution (Python):


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

Solution (Python):
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

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

Solution (Python):
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 )

Solution (Python):
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 )

Solution (Python):
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 )

Solution (Python):
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 )

Solution (Python):
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 )

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

Solution (Python):
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

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

Solution (Python):
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

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

Solution (Python):
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

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

Solution (Python):
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)

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
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

Solution (Python):
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)

Solution (Python):
findstr = raw_input().strip()
findstr = findstr.lower()
inlist = []
while True:
    tmplist = (raw_input().replace("\r"," ")).split()
    
    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

Solution (Python):



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)

Solution (Python):
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

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

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

print(count)

Solution (Python):
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)

Solution (Python):
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))

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

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

print(count)

Solution (Python):
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

Solution (Python):
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)

Solution (Python):

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)

Solution (Python):


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

Solution (Python):
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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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

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

Solution (Python):
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

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

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

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

Solution (Python):

import sys

w = input()

t = []

while 1:
    temp = input()
    if temp == "END_OF_TEXT":
        break
    t += temp.strip(".")
    t += " "

t = "".join(t).split()


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

Solution (Python):































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)

Solution (Python):































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)

Solution (Python):
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]))

Solution (Python):
W = input()
count = 0



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

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

print(count)

Solution (Python):

W = input()
count = 0
T = input()

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

print(count)

Solution (Python):
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)

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

Solution (Python):
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

Solution (Python):
import sys

match = input().lower()

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

Solution (Python):
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)

Solution (Python):
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

Solution (Python):
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

Solution (Python):
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)

Solution (Python):
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)

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

print(c)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
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))