You will receive 3 points for solving this problem.

Manao is designing the genetic code for a new type of algae to efficiently produce fuel. Specifically, Manao is focusing on a stretch of DNA that encodes one protein. The stretch of DNA is represented by a string containing only the characters 'A', 'T', 'G' and 'C'.

Manao has determined that if the stretch of DNA contains a maximal sequence of consecutive identical nucleotides that is of even length, then the protein will be nonfunctional. For example, consider a protein described by DNA string "GTTAAAG". It contains four maximal sequences of consecutive identical nucleotides: "G", "TT", "AAA", and "G". The protein is nonfunctional because sequence "TT" has even length.

Manao is trying to obtain a functional protein from the protein he currently has. Manao can insert additional nucleotides into the DNA stretch. Each additional nucleotide is a character from the set {'A', 'T', 'G', 'C'}. Manao wants to determine the minimum number of insertions necessary to make the DNA encode a functional protein.
The input consists of a single line, containing a string *s* of length *n* (1 ≤ *n* ≤ 100). Each character of *s* will be from the set {'A', 'T', 'G', 'C'}.

This problem doesn't have subproblems. You will get 3 points for the correct submission.
import sys
string = str(sys.stdin.readline())
string = list(string)
string.remove("\n")
def solution(string):
    count_A = 0
    count_T = 0
    count_G = 0
    count_C = 0
    answer = 0  
    for i  in string:
        if i == "A":
            count_A += 1
            if count_C % 2 == 0 and count_C != 0:
                answer+=1
            count_C = 0
            if count_G % 2 == 0 and count_G != 0:
                answer+=1 
            count_G = 0
            if count_T % 2 == 0 and count_T != 0:
                answer+=1
            count_T = 0
        if i == "T":
            count_T += 1
            if count_C % 2 == 0 and count_C != 0:
                answer+=1
            count_C = 0
            if count_G % 2 == 0 and count_G != 0:
                answer+=1
            count_G = 0
            if count_A % 2 == 0 and count_A != 0:
                answer+=1
            count_A = 0
        if i == "G":
            count_G += 1
            if count_C % 2 == 0 and count_C != 0:
                answer+=1
            count_C = 0
            if count_A % 2 == 0 and count_A != 0:
                answer+=1
            count_A = 0
            if count_T % 2 == 0 and count_T != 0:
                answer+=1
            count_T = 0
        if i == "C":
            count_C += 1
            if count_A % 2 == 0 and count_A != 0:
                answer+=1
            count_A = 0
            if count_G % 2 == 0 and count_G != 0:
                answer+=1
            count_G = 0
            if count_T % 2 == 0 and count_T != 0:
                answer+=1
            count_T = 0
    return print(answer)
solution(string)