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:

t = str(input())
t = t.lower()
c = 0

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

Submission status: Accepted

Solution code:
# coding: utf-8
# 57
w = input()
c = int(0)
while True:
    T = input()
    if T=='END_OF_TEXT':
        break
    T = T.lower()
    T = T.split()
    c += T.count(w)
    
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

W = input()

try:
   S = 0
   while True:
      T = input()
      if T == "END_OF_TEXT":
         break
      T = T.lower()
      T = T.split(" ") #空白で区切られた文字列を分割する
      #print(T)
      
      for i in range(len(T)):
         if W == T[i]:
            S += 1
      
except EOFError:
   pass

print(S)

Submission status: Accepted

Solution code:
def resolve():
    import re
    W = input()
    s = input()
    r = re.compile(r"\b" + W + r"\b", flags=re.IGNORECASE)
    sumA = 0
    while s != "END_OF_TEXT":
        sumA += len(r.findall(s))
        s = input()
    print(sumA)


resolve()

Submission status: Accepted

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

text = ""; all_text = ""
while text != "END_OF_TEXT":
    text = input()
    all_text += text + " "
    
T = list(all_text.lower().split())[:-1]


count = 0
for i, text in enumerate(T):
    if W == text:
        count += 1

print(count)

Submission status: Accepted

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

    line = line.lower()
    pos = 0
    start = 0
    inWord = False
    while pos < len(line):
        if line[pos] == ' ':
            if inWord:
                if w == line[start:pos]:
                    cnt += 1
                inWord = False
        else:
            if not inWord:
                start = pos
                inWord = True
        pos += 1
    if inWord and w == line[start:]:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
w = input()
t = []
while True:
    tmp = input()
    if tmp == 'END_OF_TEXT':
        break
    else:
        t += list(tmp.lower().split())
print(t.count(w))

Submission status: Accepted

Solution code:
W = input()
T = []
sum = 0

while True:
    a = input().split()
    if a[0] == "END_OF_TEXT":
        break
    else:
        for i in range(len(a)):
            a[i] = a[i].lower()
        T.append(a)

for i in range(len(T)):
    sum += T[i].count(W)


print(sum)

Submission status: Accepted

Solution code:
import sys

def find_word_v4():
    W = input()
    s = sys.stdin.readline()
    count = 0

    while s != "END_OF_TEXT\n" and s != "END_OF_TEXT":
        words = s.lower().split()
        count += words.count(W)
        s = sys.stdin.readline()

    print(count)


if __name__ == "__main__":
    find_word_v4()

Submission status: Accepted

Solution code:
a = str(input())
total = 0
while 1:
    b = str(input()).split()
    if str("END_OF_TEXT") in b:
        break
    for i in b:
        if a == i.lower():
            total += 1
print(total)

Submission status: Accepted

Solution code:
P = str(input()).upper()

lines = []

while True:
    tmp = str(input())
    if tmp == "END_OF_TEXT":
        break
    lines += tmp.upper().split()
    
ans = 0
for word in lines:
    if word == P:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
W = input()
w = len(W)

TLIST = []
while True:
    T = input()
    
    if T=='END_OF_TEXT':
        break
    
    T = T.lower()
    Tlist = T.split(' ')
    TLIST.append(Tlist)

TLISTl = len(TLIST)

count = 0
for i in range(TLISTl):
    text = TLIST[i]
    textl = len(text)
    for k in range(textl):
        if text[k]==W :
            count += 1

print(count)

Submission status: Accepted

Solution code:
word = input()
textArray = []

while True:
    T = input()
    if T == 'END_OF_TEXT':
        break
    T = T.lower().split()
    textArray += T
    
answer = 0
word = word.lower()
for v in textArray:
    if v == word:
        answer += 1
print(f"{answer}")

Submission status: Accepted

Solution code:
import sys

F = sys.stdin
search_word = F.readline()
search_word = search_word.rstrip()
sentence = []
cnt = 0

for line in F:
    if line == F:
        continue
    if line == "END_OF_TEXT":
        break
    
    line = line.rstrip()
    line = line.split()
    tmp = []
    for j in line:
        j = j.lower()
        tmp.append(j)
    sentence.extend(tmp)
    
for i in sentence:
    if search_word == i:
        cnt += 1
        
print(cnt)

Submission status: Accepted

Solution code:
import sys

w = input()
w.replace('\n','')
cnt = 0

for l in sys.stdin:
    if l == "END_OF_TEXT\n":
        break
    l = l.lower()
    word = l.split()
    cnt = cnt + word.count(w)

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
target = input()
count = 0

while True:
    word_list = [x for x in input().split()]
    if word_list[0] == "END_OF_TEXT":
        break
    else:
        for word in word_list:
            if target == word.lower():
                count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
T = input()
T = T.lower()
W = []
cnt = 0

while True:
    A = list(map(str, input().split()))
    if 'END_OF_TEXT' in A:
        break
    else:
        for word in A:
            word = word.lower()
            if word == T:
                cnt += 1
        
print(cnt)

Submission status: Accepted

Solution code:
word=input()
ans = 0
while True:
    s = input()
    if s != 'END_OF_TEXT':
        s = s.lower()
        x = list(s.split(' '))
        ans +=x.count(word)
    else:
        print(ans)
        break

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input();s=[]
while 1:
    a = input()
    if a == 'END_OF_TEXT':break
    s += a.lower().split()
print(s.count(w))

Submission status: Accepted

Solution code:
w = str(input()).upper()
T = []
count = 0
while True: 
    t = str(input())
    if t == 'END_OF_TEXT': break
    T += t.upper().split()
for word in T:
    if w == word:
        count += 1
        
print('{}'.format(count))

Submission status: Accepted

Solution code:
W = input()

sentence = ''
while True:
    temp = input()
    if temp == 'END_OF_TEXT':
        break
    sentence += ' ' + temp

t = sentence.lower().split()

print(t.count(W))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
target = input()
cnt = 0
while True:
  serach_sentence = list(input().split())
  if serach_sentence[0] == 'END_OF_TEXT':
    break
  
  for sen in serach_sentence:
    if target == sen.lower():
      cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys
W = input().lower()
arr = []
for line in sys.stdin:
    if line == 'END_OF_TEXT':
        break
    arr += line.lower().strip('\n').split(' ')

print(len([i for i in arr if i == W]))

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
W = input()
ans = 0
while True:
	s = input()
	if s == "END_OF_TEXT":
		break
	for word in s.split():
		if word.lower() == W:
			ans += 1
print(ans)

Submission status: Accepted

Solution code:
def main():
  t = input().lower()

  r = 0
  while True:
    sentence = input()

    if sentence == 'END_OF_TEXT':
      break

    sentence = sentence.split(' ')
    
    for word in sentence:
      if word.lower() == t:
        r += 1

  print(r)

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
w = input().lower()
arr = []
while True:
	sinput = list(map(str,input().split()))
	if sinput == ['END_OF_TEXT']:
		break
	for s in sinput:
		arr.append(s.lower())

print(arr.count(w))

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input()
t = ""

while True:
    it = input()
    if it == "END_OF_TEXT":
        break
    it = it + " "
    t += it
t = str.lower(t)
t = t.split()

ans = 0

for i in t:
    if i == w:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys 

W=input()
text=sys.stdin.read()
print(text.lower().split().count(W))

Submission status: Accepted

Solution code:
P = str(input()).upper()
line = []

while True:
    tline = str(input())
    if tline == 'END_OF_TEXT':
        break
    line += tline.upper().split()

ans = 0

for tword in line:
    if tword == P:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
w = input()
cnt = 0
while 1:
    ts = input().split()
    if ts == ["END_OF_TEXT"]:
        break
    ts = list(map(str.lower,ts))
    for t in ts:
        if t == w:
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
W = input()
S = []

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

w = input()

print(sys.stdin.read().lower().split().count(w))

Submission status: Accepted

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

input_str = []

while True:
    input_value = input()
    if input_value == "END_OF_TEXT":
        break
    else:
        input_str.append(input_value.lower().split())

input_str=sum(input_str,[])

count = 0
for i in input_str:
    if W == i :
        count += 1
print(count)

Submission status: Accepted

Solution code:
w = input()
c = 0
e = "END_OF_TEXT"
end = 0

while end == 0:
    t = input()
    ti = t.split()
    for i in ti:
        if i.lower() == w:
            c += 1
        if i == e:
            end = 1

print(c)

Submission status: Accepted

Solution code:
W = input()
cnt = 0

while True :
    t = input()
    
    if t == "END_OF_TEXT" :
        break
    else :
        T = t.lower()
        T = T.split()
        
        for i in range(len(T)) :
            if T[i] == W :
                cnt += 1
                      
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

word = input()
counter = 0
while 1:
    sentence = input()
    if sentence == 'END_OF_TEXT':
        break
    sentence = sentence.lower()
    l_sentence = sentence.split()
    counter += l_sentence.count(word)

print(counter)

Submission status: Accepted

Solution code:
s = input()
n = 0
while True:
    llist = input().split(" ")
    if llist[0] == "END_OF_TEXT":
        print(n)
        break
    else:
        i = len(llist)
        for m in range(0,i):
            m = int(m)
            if llist[m].lower() == s:
                n += llist[m].lower().count(s)
        continue

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W=input()
T=[]
while(1):
    t=input()
    if(t=="END_OF_TEXT"):
        break
    T.extend(t.lower().split())
#print(T)
count=0
for t in T:
    if(t==W):
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = str(input())
list = []
while True:
    T = str(input())
    if T == "END_OF_TEXT":
        break
    list.append(T.lower())

counter = 0
for i in range(len(list)):
    counter += list[i].split().count(W)
print(counter)

Submission status: Accepted

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

cnt = 0
for p in t:
  if w == p.lower() :
    cnt += 1
  
print(cnt)

Submission status: Accepted

Solution code:
W = input()
T = input().split()

count = 0
while T != ["END_OF_TEXT"]:

    for i in range(len(T)):
        if T[i].lower() == W :
            count += 1
    T = input().split()
#count = T.lower().count(W)

print(count)

Submission status: Accepted

Solution code:
fw = input()
mt = ''
cnt = 0
while True:
    st = input()
    if st == 'END_OF_TEXT':
        break
    elif fw in st.lower():
        for t in st.lower().split():
            if fw == t:
                cnt += 1

    mt += st.lower()

print(cnt)

Submission status: Accepted

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

print(T.count(W))

Submission status: Accepted

Solution code:
w = input()
count = 0
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    count += sum([1 for t2 in [t.lower() for t in line.split()] if t2 == w])
print(count)

Submission status: Accepted

Solution code:
import sys
W = sys.stdin.readline().rstrip()
cnt_W = 0

for e in sys.stdin:
    words = []
    if e == "END_OF_TEXT":
        break
    words = list(e.lower().split())
    
    cnt_W += words.count(W)
print(str(cnt_W))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = input()
text = []
while True:
    line = input()
    if(line == "END_OF_TEXT"): break
    [text.append(str.lower()) for str in line.split()]
    
ans = 0
for str in text:
  if str == word: ans += 1

print(ans)

Submission status: Accepted

Solution code:
w = input()
T = []

while True:
    t = list(input().split())
    if t == ['END_OF_TEXT']:

        break
    else:
        t = [s.lower() for s in t]
        T.append(t)

total = 0
for line in T:
    total += line.count(w.lower())

print (total)

Submission status: Accepted

Solution code:
target = input()
lst = []
while True:
    line = input()
    if line == "END_OF_TEXT":
        break
    else:
        lst.append(line.split())
c = 0
for line in lst:
    for word in line:
        if word.lower() == target.lower():
            c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

while True:
        Text = input()
        if Text == "END_OF_TEXT":
                break
        else:
                Text = [t.lower() for t in Text.split()]

                for t in Text:
                        f = 0
                        if len(t) == len(w):
                                f = 1
                                for i,j in zip(t,w):
                                        if i != j:
                                                f = 0
                                                break
                                        
                                if f == 1:
                                        ans += 1


print(ans)

Submission status: Accepted

Solution code:
import itertools


if __name__ == "__main__":
    matching_word = input()

    matching_word = matching_word.lower()

    text = []

    while True:
        line = input()

        if line == 'END_OF_TEXT':
            break

        text.append(line)

    words = list(map(lambda word: word.lower(), itertools.chain.from_iterable(map(lambda line: line.split(), text))))

    num_occurrences = words.count(matching_word)

    print(num_occurrences)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = str(input()).upper()
paragraph = []

while True:
    sentence = str(input())
    if sentence == 'END_OF_TEXT':
        break
    else:
        paragraph += sentence.upper().split()

ans = 0

for para_word in paragraph:
    if para_word == word:
        ans += 1

print("%d"%(ans))

Submission status: Accepted

Solution code:
def main():
    W = input()
    answer = 0
    while True:
        T = input()
        if T == 'END_OF_TEXT':
            break
        for word in T.split():
            answer += 1 if word.lower() == W else 0 
    print(answer)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
word = input()

count = 0
while True:
    line = input()
    if line == 'END_OF_TEXT':
        break
    count += len(list(filter(lambda s: s.lower() == word, line.split())))

print(count)

Submission status: Accepted

Solution code:
W = input()
cnt = 0
for s in iter(input,'END_OF_TEXT'):
    L = s.split(' ')
    for l in L:
        if W == l.lower():
            cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
sentence = []
cnt = 0
for string in iter(input, "END_OF_TEXT"):
    if cnt == 0:
        w = string.lower()
    else:
        sentence.append(string.lower().rstrip(".").split())
    cnt += 1

w_cnt = 0

for s in sentence:
    w_cnt += sum([1 for i in s if i == w])

print(w_cnt)

Submission status: Accepted

Solution code:
w = input()
count = 0

while True:
    t = input().split()
    if "END_OF_TEXT" in t:
        break

    t = [word.lower() for word in t]
    if w in t:
        count += t.count(w)

    
print(count)

Submission status: Accepted

Solution code:
word=input()
count=0
while True:
    text=list(input().split())
    if text[0]=="END_OF_TEXT":
        break
    for k in range(0,len(text)):
        if word==text[k].lower():
          count+=1
print(count)

Submission status: Accepted

Solution code:
w = input()

s = []
while True:
    tmp = input()
    if tmp == "END_OF_TEXT":
        break
    s += tmp.lower().split()

print(s.count(w))

Submission status: Accepted

Solution code:

# 小文字にしとく
W = input().lower()
# Wの分だけansに+=する
ans = 0
while True:
    T = input()
    if T == "END_OF_TEXT":
        break
    ans += T.lower().split().count(W)
print(ans)

Submission status: Accepted

Solution code:
import sys

W = sys.stdin.readline().rstrip().lower()
T = list(sys.stdin.read().lower().split())

print(T.count(W))

Submission status: Accepted

Solution code:
import sys
W, T = sys.stdin.read().split(maxsplit=1)
print(T.lower().split().count(W))

Submission status: Accepted

Solution code:
# Problem - 単語の検索

# input
W = input()

# initialization
word_count = 0
is_finish = False

# count
while True:
    word_list = input().split()
    for w in word_list:
        if w=='END_OF_TEXT':
            is_finish = True
            break
        w = w.lower()
        if w==W:
            word_count += 1
    if is_finish:
        break

# output
print(word_count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
word=input()
exam_text=[]
while True:
    text = input().split()
    if text[len(text)-1]=="END_OF_TEXT":
        break
    else:
        exam_text+=text
for i in range(len(exam_text)):
    exam_text[i] = exam_text[i].lower()

print(exam_text.count(word))

Submission status: Accepted

Solution code:
W = str(input())
W = W.lower()
cnt = 0
while True:
    T = [x for x in input().split()]
    if T==['END_OF_TEXT']:
        break
    for t in T:
        if t.lower()==W:
            cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
w = input()

tlist = []
while True:
    t = input()
    if t == "END_OF_TEXT":
        break
    t = t.lower()
    tlist.append(t)
moji = ' '.join(tlist)
word = moji.split()
print(word.count(w))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input().lower()
ans = 0
while 1:
    S = list(input().split())
    if len(S) == 1 and S[0] == "END_OF_TEXT":
        break
    for i in S:
        if i.lower() == W:
            ans += 1
print(ans)

Submission status: Accepted

Solution code:
W = input()

T = []
x = 0

while True:
    
    Ti = input().split()
    
    if Ti == ["END_OF_TEXT"]:
        break
        
    T += Ti
    
for i in T:
    i = i.rstrip("." or ",")
    i = i.lower()
   
    if i == W:
        x += 1

print(x)

Submission status: Accepted

Solution code:
w = input().lower()
cnt = 0
for i in iter(input, 'END_OF_TEXT'):
    cnt += i.lower().split().count(w)
print(cnt)

Submission status: Accepted

Solution code:
cnt = 0
W = input()
while True:
    T = input().split()
    if T[0] == 'END_OF_TEXT' :
        break
    else :
        T=list(map(str.lower,T)) #すべての単語を小文字に変換
        cnt += T.count(W)

print(cnt)

Submission status: Accepted

Solution code:
w = input().upper()
ans = 0

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

Submission status: Accepted

Solution code:
s = str(input().upper())

count = 0
while True:
  moji = str(input())
  if moji == "END_OF_TEXT":
    break;
  elif moji == "end_of_text":
    continue;
  else:
    let = moji.upper()
    lst = let.split()
    count += lst.count(s)
print(count)

Submission status: Accepted

Solution code:
W=input()
sum=0
while 1:
    s=input()
    if s=="END_OF_TEXT":
        break
    s_=s.split()
    for i in s_:
        if i.lower()==W.lower():
            sum+=1
print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cntw)

Submission status: Accepted

Solution code:
w = input()
ans = 0

while True:
    try:
        t = input()
    except:
        break
    
    t = t.lower()
    t = t.split(" ")
    for i in t:
        if i == w:
            ans += 1
            
print(ans)

Submission status: Accepted

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

s = input()

tmp = sys.stdin.read().lower().split()

print(tmp.count(s))

Submission status: Accepted

Solution code:
target = input()
cnt=0
while True:
    s=input()
    if s == "END_OF_TEXT":
        print(cnt)
        exit()
    cnt+=s.lower().split().count(target)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input()

t = []
while True:
    t0 = input()
    if t0 == 'END_OF_TEXT':
        break
    t.append(t0)

tt = []
for s in t:
    for s_sp in s.split():
        tt.append(s_sp)

count = 0
for s in tt:
    if w == s.lower(): count += 1

print(count)

Submission status: Accepted

Solution code:
import re
W = input()
T = input()
T = T.lower()
L = []
while T != 'END_OF_TEXT':
    L.append(re.split(r'\s',T.lower()))
    T = input()
n = 0
for i in range(len(L)):
    for j in range(len(L[i])):
        if L[i][j] == W:
            n += 1
    # if re.findall(W,i):
    #     n += len(re.findall(W,i))
print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    ans = 0
    word = input().strip()
    while True:
        s = input().strip()
        if s == "END_OF_TEXT":
            break
        for w in s.split():
            if word == w.lower():
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

target = input()
s = ""

while True:
    tmp = input()
    if tmp == "END_OF_TEXT":
        break
    s += tmp + " "

words = s.lower().split()

print(words.count(target))

Submission status: Accepted

Solution code:
target = input()
count = 0

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

print(count)

Submission status: Accepted

Solution code:
#2020-03-20
word = input()
count = 0
while True:
    sentence = input()
    if sentence == 'END_OF_TEXT':
        break
            
    count += sentence.lower().split().count(word)

print(count)

Submission status: Accepted

Solution code:
W = input().upper()
line =[]

while True:
    temp_line = input()
    if temp_line == "END_OF_TEXT":
        break
    line += temp_line.upper().split()

ans = 0

for temp_word in line:
    if temp_word == W:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = input()
sentences = []
while True:
  s = input()
  if s == "END_OF_TEXT":
    break
  sentences += list(map(lambda sentence:sentence.lower(),s.split()))
print(sentences.count(word))

Submission status: Accepted

Solution code:
w = input()
t_list = list()
while True:
    t = input()
    if t == "END_OF_TEXT":
        break
    t_list.append(t)

cnt = 0
for t in t_list:
    for word in t.split(" "):
        if w.lower() == word.lower():
            cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    keyword = input()
    sentence = ''
    while(True):
        cont = input()
        if cont == 'END_OF_TEXT':
            break
        sentence = sentence + cont + '\r'
    sentence = sentence.lower()
    senten_list = sentence.split()
    num = 0
    for sentence in senten_list:
        if sentence == keyword:
            num += 1
    print(num)

Submission status: Accepted

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

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

print(T.count(W))

Submission status: Accepted

Solution code:
word=input()
num=0
while True:
    lst=input().split()
    if lst[0]=='END_OF_TEXT':
        break
    lst=[i.lower() for i in lst]
    num+=lst.count(word)
    
print(num)

Submission status: Accepted

Solution code:
word = input().upper()
cnt = 0

while True:
    letter = input()

    if letter == 'END_OF_TEXT':
        break

    letter = letter.upper().split()

    cnt += letter.count(word)

print(cnt)