s = 'gfdhbobobyui'
bob = 0
for x in range(len(s) -3):
     if s[x:x+3] == 'bob':  # From x to three 3 characters ahead.
         bob += 1
print('Number of times bob occurs is: ' + str(bob))