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.


-----Input-----

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.


-----Output-----

The program should print on one line a single integer representing the minimum number of 'A', 'T', 'G', 'C' characters that are required to be inserted into the input string in order to make all runs of identical characters have odd length.


-----Examples-----
Input
GTTAAAG

Output
1

Input
AACCAACCAAAAC

Output
5



-----Note-----

In the first example, it is sufficient to insert a single nucleotide of any type between the two 'T's in the sequence to restore the functionality of the protein.

Difficulty: interview

Starter code:

Solutions:
s=input()
result=0
sub=0
last=s[0]
for x in s:
     if x==last: sub+=1
     else:
          if sub%2==0: result+=1
          sub=1
     last=x

if sub%2==0: result+=1
print(result)
          






s = k = j = 0
for i in input():
    if i == j: k += 1
    else:
        s += k % 2
        k, j = 0, i
print(s + k % 2)

s=input()

p=s[0]
cnt=1
ans=0
for i in range(1,len(s)):
    if(s[i]==p):
        cnt+=1
    else:
        if(cnt%2==0):
            ans+=1
        p=s[i]
        cnt=1
if(cnt%2==0):
    ans+=1
print(ans)


s = input()
piece = ''
count = 0
for i in range(len(s)-1):
    if s[i+1] != s[i]  :
        piece += s[i]
        #print(piece)
        if len(piece) % 2 == 0 :
            count += 1
        piece = ''
    else:
        piece += s[i]
        if i == len(s)-2 and s[len(s)-2] == s[len(s)-1]:
            piece += s[-1]
            if len(piece) % 2 == 0 :
                count += 1
            
   
    
print(count)

from itertools import groupby
print(sum(1 for k, g in groupby(input()) if len(list(g)) % 2 == 0))

s=input()
Pred=''
C=0
D=0
for i in s:
    if i==Pred:
        C+=1
    if i!=Pred:
        if C%2==0 and C!=0:  D+=1
        C=1
        Pred=i
if C%2==0 and C!=0:  D+=1
print(D)

import sys

sys_in = input()

def counter(dna):
	count = 1
	even_count = 0
	previous = dna[0]
	dna = dna[1:]
	while(dna != ""):
		if dna[0] == previous:
			count += 1
		else:
			previous  = dna[0]
			if count % 2 == 0:
				even_count += 1
			count = 1
		dna = dna[1:]
	if count%2 == 0 and count != 0:
		even_count+=1
	return even_count

print(str(counter(sys_in))+"\n") 


def main():
    line = input()
    array = []
    count = 0
    even = 0
    for char in line:
        if array == [] or array[-1] == char:
            array.append(char)
            count += 1
        else:
            array.append(char)
            if count % 2 == 0:
                even += 1
            count = 1
    if count % 2 == 0:
        even += 1
    print(even)

main()


def main():
    a, cnt, res = '*', 1, 0
    for b in input() + '*':
        if a != b:
            res += 1 - (cnt & 1)
            cnt = 1
            a = b
        else:
            cnt += 1
    print(res)


def __starting_point():
    main()

__starting_point()

s=input()
x=1
c=s[0]
n=0
for i in range(1,len(s)):
    if s[i]==c:
        x+=1
    else:
        if x%2==0:
            n+=1
        x=1
        c=s[i]
        
if x%2==0:
    n+=1

print(n)


k=1
p=r=0
for x in input()+'0':
	if x!=p:r+=1-k%2;k=0;p=x
	k+=1
print(r)

a=input()
a=" ".join(a)
a=a.split()
suma=0
contador=0
for k in range (len(a)):
        if a[k]!="*":
                igual=a[k]
                contador=0
                for r in range (k+1,len(a)):
                        if a[k]==a[r]:
                                contador=contador+1
                                a[r]="*"
                        else:
                                break
                if contador%2!=0:
                        suma=suma+1
print(suma)

k=1
p=r=0
for x in input()+'0':
	if x!=p:r+=1-k%2;k=0;p=x
	k+=1
print(r)

# Made By Mostafa_Khaled 
bot = True 
k=1

p=r=0

for x in input()+'0':

	if x!=p:r+=1-k%2;k=0;p=x

	k+=1

print(r)

# Made By Mostafa_Khaled


s = input() + "\0"

c = 0
lp = 0

for i, e in enumerate(s):
	#print(i, s[lp], e)
	if s[lp] != e:
		if (i - lp) % 2 == 0:
			c += 1
		lp = i



print(c)


s=input()
nb=1
n=0
for i in range(len(s)-1):
 if (s[i]!=s[i+1]) and (nb%2==0):
   n+=1
   nb=1
 elif (s[i]!=s[i+1]):
     nb=1
 else:
     nb+=1
if nb%2==0:
    print(n+1)
else:
    print(n)


def count(sequence):
    result = 0
    current_length = 1
    for (i, x) in enumerate(sequence):
        if i == 0: continue
        if sequence[i - 1] == x:
            current_length += 1
            continue

        if current_length % 2 == 0:
            result += 1

        current_length = 1

    if current_length % 2 == 0:
        result += 1

    return result


def main():
    sequence = input()
    print(count(sequence))


def __starting_point():
    main()

__starting_point()

s = input()
result = 0
last_ch = s[0]
last_ch_len = 1
for i in range(1, len(s)):
    if s[i] == last_ch:
        last_ch_len += 1
    else:
        if last_ch_len%2 == 0:
            result += 1
        last_ch_len = 1
        last_ch = s[i]
    #print('{} {} {} {}'.format(s[i], last_ch, last_ch_len, result))
if last_ch_len%2 == 0:
    result += 1
print(result)


n = input()
x = 1
cnt = 0
for i in range(len(n)-1):
    if(n[i] == n[i+1]):
        x+=1
    else:
        if(x % 2 == 0):
            cnt += 1
            x = 1
if(x % 2==0):
    print(cnt+1)
else:
    print(cnt)
    


#input for the string for code
code=input()
curr=code[0]
curr_count=1
add_count=0
n=len(code)
for i in range(1,n):
    if code[i]==curr:

        curr_count+=1
        if i==n-1:
            if curr_count%2==0:
                add_count+=1
                # print("There was even number of:"+code[i-1])

    else:
        curr=code[i]

        #if even number
        if curr_count%2==0:
            add_count+=1
            # print("There was even number of:"+code[i-1])
        curr_count=1
    # print("curr is now:"+str(curr))
    # print("curr_count is now:"+str(curr_count))
print(add_count)


def __starting_point():
    import re

    string = input()
    result = sum(1 for a in re.compile('[A]+').findall(string) if len(a) % 2 == 0)
    result += sum(1 for a in re.compile('[T]+').findall(string) if len(a) % 2 == 0)
    result += sum(1 for a in re.compile('[G]+').findall(string) if len(a) % 2 == 0)
    result += sum(1 for a in re.compile('[C]+').findall(string) if len(a) % 2 == 0)

    print(result)

__starting_point()

sequence=input()
changes=0
even=True
last = sequence[0]
for i in range(0,len(sequence)):
    if last == sequence[i]:
        even = not even
    else:
        if even:
            changes+=1
        even=False
    last = sequence[i]
if even:
    changes+=1
print(changes)

sequence=input()
changes=0
even=True
last = sequence[0]
for i in range(0,len(sequence)):
    if last == sequence[i]:
        even = not even
    else:
        if even:
            changes+=1
        even=False
    last = sequence[i]
if even:
    changes+=1
print(changes)