Python 3:
n = input()
total = 0
for index in range(len(n) - 1):
if int(n[index] + n[index + 1]) % 3 == 0:
total += 1
print(total)
Python 3:
n = input()
total = 0
for index in range(len(n) - 1):
if int(n[index] + n[index + 1]) % 3 == 0:
total += 1
print(total)