Problem:

Finding a Word

Write a program which reads a word W and a text T, and prints the number of word W which appears in text T

  T consists of string Ti separated by space characters and newlines. Count the number of Ti which equals to W. The word and text are case insensitive.

Constraints

  
The length of W ≤ 10

  
W consists of lower case letters

The length of T in a line ≤ 1000

Input

  In the first line, the word W is given. In the following lines, the text T is given separated by space characters and newlines.

"END_OF_TEXT" indicates the end of the text.

Output

  Print the number of W in the text.

Sample Input

computer
Nurtures computer scientists and highly-skilled computer engineers
who will create and exploit "knowledge" for the new era.
Provides an outstanding computer environment.
END_OF_TEXT

Sample Output

3



Sample input:
computer
Nurtures computer scientists and highly-skilled computer engineers
who will create and exploit "knowledge" for the new era.
Provides an outstanding computer environment.
END_OF_TEXT


Sample output:
3

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():

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

    print (Counter)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from functools import reduce

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

def count_if(f, lst):
    count = 0

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

    return count

def main():
    count = 0

    word = input()

    while True:
        line = input();

        if line == 'END_OF_TEXT':
            break

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

    print(count)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import re
w = input().lower()
t = ''
while True:
    s = input().lower()
    if s == 'end_of_text':
        break
    t += s

print(len(re.findall(w, t)))

Submission status: Wrong Answer

Solution code:
import collections
w = input().lower()
t = []
cnt = collections.Counter()
while True:
    s = [i.lower() for i in input().split()]
    if s[0] == 'end_of_text':
        break
    t += s
for word in t:
    cnt[word] += 1
print(cnt[w])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
target = input()
text = input()
textb = input()
text2 = text.replace('\n',' ')
sentenceList = text2.split()
count = 0
for word in sentenceList:
 if(word.lower() == target):
  count+=1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
a = input()
lines = ""
for line in sys.stdin:
    lines += line.lower()
print(lines.count(a))

Submission status: Wrong Answer

Solution code:
import sys
a = input()
lines = []
for line in sys.stdin:
    lines.append(line.lower().split())
print(lines.count(a))

Submission status: Wrong Answer

Solution code:
import sys
a = input()
lines = ""
for line in sys.stdin:
    lines += line.lower()
lis = lines.split()
print(lines.count(a))

Submission status: Wrong Answer

Solution code:
import sys
a = input()
lines = ""
for line in sys.stdin:
    lines += line.lower()
lis = lines.split(" ")
print(lines.count(a))

Submission status: Wrong Answer

Solution code:
import sys
a = input()
lines = ""
for line in sys.stdin:
    lines += line.lower()+" "
lis = lines.split(" ")
print(lines.count(a))

Submission status: Wrong Answer

Solution code:
import sys
a = input()
lines = ""
for line in sys.stdin:
    lines += line.lower()+" "
lis = lines.split(" ")
print(lis.count(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
word = input()
text = []
while True:
    input_text = input()
    if input_text == "END_OF_TEXT":
        break
    text.append(input_text)

ans = 0
for line in text:
    ans += line.count(word)

print(ans)

Submission status: Wrong Answer

Solution code:
word = input()
text = []
while True:
    input_text = input()
    if input_text == "END_OF_TEXT":
        break
    text.append(input_text.upper())

ans = 0
for line in text:
    ans += line.count(word.upper())

print(ans)

Submission status: Wrong Answer

Solution code:
import re
word = input()
text = []
while True:
    input_text = input()
    if input_text == "END_OF_TEXT":
        break
    text.append(input_text.upper())

ans = 0
for line in text:
    ans += len(re.findall("(?i)" + word.upper(), line))

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
T = raw_input()
s = ""
while True:
    tmp = raw_input()
    if tmp == "END_OF_TEXT":
        break
    else:
        s+=tmp
print s.count(T)

Submission status: Wrong Answer

Solution code:
T = raw_input()
s = ""
while True:
    tmp = raw_input()
    if tmp == "END_OF_TEXT":
        break
    else:
        s+=tmp
print s.lower().count(T)

Submission status: Wrong Answer

Solution code:
T = raw_input().lower()
s = ""
while True:
    tmp = raw_input()
    if tmp == "END_OF_TEXT":
        break
    else:
        s+=tmp
print s.lower().count(T)

Submission status: Wrong Answer

Solution code:
T = raw_input().lower()
s = ""
while True:
    tmp = raw_input()
    if tmp == "END_OF_TEXT":
        break
    else:
        s+=" "+tmp
print s.lower().count(T)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
W = str(input()).lower() 
T = str(input()).lower() *2

print(T.count(W))

Submission status: Wrong Answer

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

table = []

while True:
    
    T = str(input()).lower()
    if T == "end_of_text":
        break
    
    table.append(T)
    
    
print("".join(table).count(W))

Submission status: Wrong Answer

Solution code:
#Finding a Word

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

table = []

while True:
    
    T = str(input())
    if T == "END_OF_TEXT":
        break
    else:
        T = T.lower()
    
    table.append(T)
    
    
print("".join(table).count(W))

Submission status: Wrong Answer

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

table = []
count = 0

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

Submission status: Wrong Answer

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

table = []
count = 0

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

Submission status: Wrong Answer

Solution code:
import sys
W = input()
T = sys.stdin.read()
ans = 0
for i in range(len(T)-len(W)+1):
    for j in range(len(W)):
        if T[i+j] == W[j]:
            if j == len(W)-1:
                ans += 1
            continue
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
W = input()
ans = 0
while True:
    T = input()
    if T == "END_OF_TEXT":break
    for i in range(len(T)-len(W)+1):
        for j in range(len(W)):
            if T[i+j] == W[j]:
                if j == len(W)-1:
                    ans += 1
                continue
            break
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
W = input()
ans = 0
while True:
    T = input()
    if T == "END_OF_TEXT":break
    for i in range(len(T)-len(W)+1):
        for j in range(len(W)):
            if T[i+j].lower() == W[j] :
                if j == len(W)-1:
                    ans += 1
                continue
            break
print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin

W = stdin.readline().rstrip()
T = stdin.read().replace("END_OF_TEXT", ".").lower()
print(len(T.split(sep=W))-1)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import re

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

Submission status: Wrong Answer

Solution code:
import re
word = str(input())
all = ''
while True:
    sentence = str(input())
    if sentence == 'END_OF_TEXT':
        break
    all += ' ' + sentence
all = all.strip()
result = re.findall(word, all)
print(len(result))

Submission status: Wrong Answer

Solution code:
import re
word = str(input())
all = ''
while True:
    sentence = str(input())
    if sentence == 'END_OF_TEXT':
        break
    all += ' ' + sentence
all = all.strip().lower()
result = re.findall(word, all)
print(len(result))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import re

W = input().rstrip()

ans = 0
while True:
	line = input().rstrip()
	if line == 'END_OF_TEXT': break
	else: ans += len(re.findall(W, line))

print(ans)

Submission status: Wrong Answer

Solution code:
import re

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

ans = 0
while True:
	line = input().rstrip()
	if line == 'END_OF_TEXT': break
	else: ans += len(re.findall(W, line.lower()))

print(ans)

Submission status: Wrong Answer

Solution code:
print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
findmoji = input()

mojilist = ""
while True:
	oneline = input()
	if oneline == "END_OF_TEXT":
		break
	else:
		mojilist += oneline

print(mojilist.count(findmoji))

Submission status: Wrong Answer

Solution code:
findmoji = input()

mojilist = ""
while True:
	oneline = input()
	if oneline == "END_OF_TEXT":
		break
	else:
		mojilist += oneline.lower()

print(mojilist.count(findmoji))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding: UTF-8

word = input()
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]:
            cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
W=input()

Ti=[]
count=0

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

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

Submission status: Wrong Answer

Solution code:
W=input()

Ti=[]
count=0

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

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

Submission status: Wrong Answer

Solution code:
w = input()
li = list(input().split())
cnt = 0
for i in range(len(li)):
    if w ==li[i]:
        cnt +=1
print(cnt)

Submission status: Wrong Answer

Solution code:
w = input()
li = list(input().split())
cnt = 0
for i in range(len(li)):
    if w ==li[i].lower():
        cnt +=1
print(cnt)

Submission status: Wrong Answer

Solution code:
W = input()
import sys
T = sys.stdin.read()

num = 0
for i in T:
    while i.find(W) != -1:
        num += 1
        i = i.replace(W, ' ', 1)
print(num)

Submission status: Wrong Answer

Solution code:
import sys

W = input()
T = sys.stdin.read()
# T = []
# for i in range(4):
#     T.append(input())

num = 0
for i in T:
    while i.lower().find(W) != -1:
        num += 1
        i = i.lower().replace(W, ' ', 1)
print(num)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
target = input()
data = sys.stdin.read()
data.replace("END_OF_TEXT","")
print("%d" %(data.lower().count(target)))

Submission status: Wrong Answer

Solution code:
import sys
target = input()
data = sys.stdin.read()
data.replace("END_OF_TEXT","")
print("%d" %(data.lower().count(target.lower())))

Submission status: Wrong Answer

Solution code:
import sys
target = input()
data = sys.stdin.read()
data = data.replace("END_OF_TEXT","")
print("%d" %(data.lower().count(target.lower())))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

one_word = raw_input()
word_count = 0
word_list = []

while 1:
	temp = raw_input()
	word_list += temp.split()
	
	if word_list.pop() == "END_OF_TEXT":
		break

for word in word_list:
	if one_word == word:
		word_count += 1

print word_count

Submission status: Wrong Answer

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

while 1:
	temp = raw_input()
	word_list += temp.split()
	
	if word_list.pop() == "END_OF_TEXT":
		break

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

print word_count

Submission status: Wrong Answer

Solution code:
n=raw_input()
ans=0
while 1:
    w=raw_input()
    if w=='END_OF_TEXT':break
    ans+=w.count(n)
print ans

Submission status: Wrong Answer

Solution code:
n=raw_input().lower()
ans=0
while 1:
    w=raw_input().lower()
    if w=='end_of_text':break
    ans+=w.count(n)
print ans

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print total

Submission status: Wrong Answer

Solution code:
import sys

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
target = input()

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

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

print(count)

Submission status: Wrong Answer

Solution code:
target = input()

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

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

print(count)

Submission status: Wrong Answer

Solution code:
while True:
    try:
        W = raw_input()
        T = raw_input().split()
        if W == 'END_OF_TEXT':
            break
    except EOFError:
        break
        
    count = 0
    for word in T:
        if word == W:
            count +=1
    print count

Submission status: Wrong Answer

Solution code:
T = []
while True:
    try:
        W = raw_input()
        T.append(raw_input().split())
        if W == 'END_OF_TEXT':
            break
    except EOFError:
        break
        
count = 0
for items in T:
    if items != []:
        for word in items:
            if word.lower() == W.lower():
                count +=1
print count

Submission status: Wrong Answer

Solution code:
T = []
while True:
    try:
        W = raw_input()
        key = W
        T.append(raw_input().split())
        if W == 'END_OF_TEXT':
            break
    except EOFError:
        break
        
count = 0
for items in T:
    if items != []:
        for word in items:
            if word.lower() == key.lower():
                count +=1
print count

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

t = raw_input().split()
if t == 'END_OF_TEXT':
    pass
T.append(t)

tot = 0
for w in T:
    if W in w:
        tot+=1
print tot

Submission status: Wrong Answer

Solution code:
W = raw_input()
T = []
while True:
    t = raw_input()
    if t == 'END_OF_TEXT':
        break
    T.append(t)

tot = 0
for w in T:
    if W in w:
        tot+=1
print tot

Submission status: Wrong Answer

Solution code:
W = raw_input()
T = []
while True:
    t = raw_input()
    if t == 'END_OF_TEXT':
        break
    T.append(t)

tot = 0
for w in T:
    if W in w.split():
        tot+=1
print tot

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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.split(' ').count(s_str)
        else:
            pass
    c = c+1
print result

Submission status: Wrong Answer

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

keyword = raw_input()
data = ''
while True:
    i = raw_input().strip('\n')
    if i == 'END_OF_TEXT':
        break
    data += i
print data[0:-1:1].split(' ').count(keyword)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re

p = re.compile(r'[a-zA-Z0-9]+')
keyword = raw_input()
word = re.findall(p, keyword)
data = ''
while True:
    i = raw_input().strip('\n')
    if i == 'END_OF_TEXT':
        break
    data += i
index = 0
data = re.split(r' |\.|-|\?|!', data[0:-1:])
for i in data:
    data[index] = re.findall(p, i)[0]
    index += 1
print data.count(keyword)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re

p = re.compile(r'[a-zA-Z0-9]+')
keyword = raw_input()
word = re.findall(p, keyword)
data = ''
while True:
    i = raw_input().strip('\n')
    if i == 'END_OF_TEXT':
        break
    data += i
index = 0
data = re.split(r' |\.|-|\?|!', data[0:-1:])
if not data:
    for i in data:
        data[index] = re.findall(p, i)[0]
        index += 1
    print data.count(keyword)
else:
    print 0

Submission status: Wrong Answer

Solution code:
W = raw_input()
cnt = 0
while True:
    line = raw_input().split()
    if "END_OF_TEXT" in line:
        break
    cnt += line.count(W)
print cnt

Submission status: Wrong Answer

Solution code:
W = raw_input().upper()
cnt = 0
while True:
    line = map(lambda x:x.upper(), raw_input().split())
    if "END_OF_TEXT" in line:
        break
    cnt += line.count(W)
print cnt

Submission status: Wrong Answer

Solution code:
W = raw_input().upper()
cnt = 0
while True:
    line = map(lambda x:x.upper().strip(".,"), raw_input().split())
    if "END_OF_TEXT" in line[0]:
        break
    for item in line:
        if W in item:
            cnt += 1
print cnt

Submission status: Wrong Answer

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 words[i].lower() in w:    		
			cnt += 1			
print( cnt )

Submission status: Wrong Answer

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 ) ):
    	print( "[{:s}]".format( words[i] ) )
    	if w in words[i].lower():    		
			cnt += 1			
print( cnt )

Submission status: Wrong Answer

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 in words[i].lower():    		
			cnt += 1			
print( cnt )

Submission status: Wrong Answer

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.split():
        if target in word:
            count += 1
print count

Submission status: Wrong Answer

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 in word:
            count += 1
print count

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: UTF-8

i = 0
W = input()

while 1:
    T = input()
    if T == 'END_OF_TEXT':
        break
    X = ''
    X = T.split(' ')
    for x in range(len(X)):
        if X[x] == W:
            i += 1

print(i)

Submission status: Wrong Answer

Solution code:
w=raw_input()
sum=0
while 1:
    s=raw_input()
    if s=="END_OF_TEXT": break
    sum+=s.count(w)
print sum

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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.split()
	 		for i in a_list:
				if (w in i):
					count_1 += 1
	print(count_1)
	if t=='END_OF_TEXT':
		break

Submission status: Wrong Answer

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 in i):
					count_1 += 1
	print(count_1)
	if t=='END_OF_TEXT':
		break

Submission status: Wrong Answer

Solution code:
import sys

W_T = sys.stdin.read()

W = W_T[:W_T.index("\n")]
W = W.casefold()

T = W_T[W_T.index("\n") : W_T.index("END_OF_TEXT")]
T = T.casefold()

cnt = T.count("\n" + W) + T.count(" " + W + " ") + T.count(" " + W + ".") + T.count(" " + W + "\n")

print(cnt)

Submission status: Wrong Answer

Solution code:
W = input()

cnt = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
pat=input().lower()
sent=''
while True:
    ex=''
    ex=input()
    if ex=="END_OF_TEXT":
        break
    ex.lower()
    sent+=ex
print(sent.count(pat))

Submission status: Wrong Answer

Solution code:
pat=input().lower()
sent=''
while True:
    ex=''
    ex=input().lower()
    sent+=ex
    if sent.count("end_of_text"):
        break
print(sent.count(pat))

Submission status: Wrong Answer

Solution code:
pat=input().lower()
sent=''
while True:
    sent+=input().lower()
    if sent.count("end_of_text"):
        break
print(sent.count(pat))

Submission status: Wrong Answer

Solution code:
def myfindall(s,ps):
    matchlist =[]
    while True:
        tmp = s.find(ps)
        if tmp < 0 :
            break
        if len(matchlist)>0:
            matchlist.append(tmp+matchlist[-1]+1)
        else:
            matchlist.append(tmp)
        s = s[tmp+1:]
    return matchlist

findstr = raw_input().strip()
inlist = []
while True:
    tmpstr = raw_input().strip()
    # print tmpstr
    if tmpstr == "END_OF_TEXT":
        break
    inlist.append(tmpstr)
instr = "".join(inlist)
print len(myfindall(instr,findstr))