s = input() c = 0 for i in range(0, len(s)-4): if s[i:i+4] == 'love': c += 1 print(c)
배열 슬라이싱을 통해 단어를 4개씩검사해준다.