/**
 * Problem:
 * Source:
 * Link:
 *
 * @author Alexei Ostrovski
 */

import java.io.*;
import java.util.*;

public class SpidersSolver {

	public static final boolean DEBUG = false;

	public static void main(String[] args) {
		//redirect input and output
		if (DEBUG)
		{
			try {
				System.setIn(new FileInputStream("input.txt"));
				//System.setOut(new PrintStream("input.txt"));
			} catch (IOException e) {
				//nothing
			}
		}
		Scanner sc = new Scanner(System.in);

		//read data
		int n = sc.nextInt(), m = sc.nextInt();

		//solve
		if (n < m) {
			int tmp = n;
			n = m;
			m = tmp;
		}
		// Now (n >= m) && (m <= 6)
		int pow = 1;
		for (int i = 0; i < m; i++)
			pow *= 2;

		int[] count = new int[pow];
		for (int cur = 0; cur < pow; cur++)
		{
			int x = cur;
			while (x > 0)
			{
				count[cur] += (x % 2);
				x /= 2;
			}
			count[cur] = m - count[cur];
		}
		//System.out.println(Arrays.toString(count));

		int[][] C = new int[pow][pow];
		for (int cur = 0; cur < pow; cur++)
		{
			C[0][cur] = 0;//count[cur];
			for (int last = 1; last < pow; last++)
				C[last][cur] = Integer.MIN_VALUE;
		}

		for (int i = 0; i < n; i++)
		{
			int[][] newC = new int[pow][pow];

			for (int cur = 0; cur < pow; cur++)
				for (int next = 0; next < pow; next++)
				{
					int mask = cur | (cur << 1) | (cur >> 1) | next;
					mask %= pow;

					int max = 0;
					for (int last = 0; last < pow; last++)
						if (((last | mask) == pow - 1) && (max < count[cur] + C[last][cur]))
							max = count[cur] + C[last][cur];

					newC[cur][next] = max;
				}
			C = newC;
		}

		int result = 0;
		for (int cur = 0; cur < pow; cur++)
			result = Math.max(result, C[cur][0]);

		//output
		System.out.println(result);
	}
}


import java.io.*;
import java.util.*;

public class E
{
    private static final int oo = 1000000000;
    public static void main(String[] args) throws Exception
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        if(n > m)
        {
            int t = n;
            n = m;
            m = t;
        }

        int [][] curr = new int[1<<n][1<<n];
        fill(curr, oo);
        Arrays.fill(curr[0], 0);

        for(int j = 0 ; j < m ; j++)
        {
            int [][] next = new int[1<<n][1<<n];
            fill(next, oo);
            for(int c0 = 0 ; c0 < 1<<n ; c0++)
                for(int c1 = 0 ; c1 < 1<<n ; c1++)
                    if(curr[c0][c1] != oo)
                        for(int c2 = 0 ; c2 < (j == m-1 ? 1 : 1<<n) ; c2++)
                        {
                            int all = (1<<n) - 1;
                            int done = (all&(c1>>1)) | (all&(c1<<1)) | c0 | c2;
                            done &= (all^c1);

                            next[c1][c2] = Math.min(next[c1][c2], curr[c0][c1] + n - Integer.bitCount(done));

                        }
            curr = next;
        }

        int res = oo;
        for(int i = 0 ; i < 1<<n ; i++)
            for(int j = 0 ; j < 1<<n ; j++)
                res = Math.min(res, curr[i][j]);

        System.out.println(n*m - res);
    }

    private static void fill(int[][] array, int val)
    {
        for(int [] fill : array)
            Arrays.fill(fill, val);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * Author -
 * User: kansal
 * Date: 9/3/11
 * Time: 5:28 PM
 */
public class CF85C {
    public static void main(String[] args) {
        reader = new BufferedReader(new InputStreamReader(System.in));

        int height = nextInt(), width = nextInt();
        if (width > height) {
            int t = width;
            width = height;
            height = t;
        }

        final int INF = height * width + 10;
        final int ALL_BITS = (1 << width)  - 1;
        int[][][] dp = new int[height + 1][1 << width][1 << width];
        for (int[][] ints : dp) {
            for (int[] anInt : ints) {
                Arrays.fill(anInt, INF);
            }
        }

        dp[0][0][0] = 0;
        for(int r = 0; r < height; ++r) {
            for(int uncovered = 0; uncovered < (1 << width); ++uncovered) {
                for(int mask = 0; mask < (1 << width); ++mask) {
                    if (dp[r][uncovered][mask] == INF) {
                        continue;
                    }

                    for(int curMask = uncovered; curMask < (1 << width); curMask = (curMask + 1) | uncovered) {
                        int curCovered = (mask | curMask);
                        curCovered |= (curMask >> 1);
                        curCovered |= (ALL_BITS & (curMask << 1));

                        int curUncovered = ALL_BITS ^ curCovered;
                        dp[r+1][curUncovered][curMask] = Math.min(dp[r+1][curUncovered][curMask], dp[r][uncovered][mask] + Integer.bitCount(curMask));
                    }
                }
            }
        }

        int res = INF;
        for(int x: dp[height][0]) res = Math.min(res, x);

        System.out.println(height * width - res);
    }

    public static BufferedReader reader;

    public static StringTokenizer tokenizer = null;

    static String nextToken() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    static public int nextInt() {
        return Integer.parseInt(nextToken());
    }

    static public long nextLong() {
        return Long.parseLong(nextToken());
    }

    static public String next() {
        return nextToken();
    }

    static public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

}


/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
If I'm the sun, you're the moon
Because when I go up, you go down
*******************************
I'm working for the day I will surpass you
https://www.a2oj.com/Ladder16.html
*/
import java.util.*;
import java.io.*;
import java.math.*;

   public class x111C
   {
      public static void main(String omkar[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int R = Integer.parseInt(st.nextToken());
         int C = Integer.parseInt(st.nextToken());
         if(R > C)
         {
            int t = R;
            R = C;
            C = t;
         }
         //dp[c][m1][m2] = min spoders in first c columns
         int[][][] dp = new int[C+1][1 << R][1 << R];
         for(int i=0; i <= C; i++)
            for(int mask=0; mask < (1<<R); mask++)
               Arrays.fill(dp[i][mask], 69);
         for(int mask=0; mask < (1<<R); mask++)
            dp[0][0][mask] = 0;
         for(int c=1; c <= C; c++)
            for(int mask1=0; mask1 < (1<<R); mask1++)
               for(int mask2=0; mask2 < (1<<R); mask2++)
                  for(int mask3=0; mask3 < (1<<R); mask3++)
                  {
                     boolean works = true;
                     for(int b=0; b < R; b++)
                        if((mask2&(1<<b)) == 0)
                        {
                           if(b > 0 && (mask2&(1<<(b-1))) > 0);
                           else if(b+1 < R && (mask2&(1<<(b+1))) > 0);
                           else if((mask1&(1<<b)) > 0);
                           else if((mask3&(1<<b)) > 0);
                           else  works = false;
                        }
                     if(works)
                        dp[c][mask2][mask3] = Math.min(dp[c][mask2][mask3], dp[c-1][mask1][mask2]+Integer.bitCount(mask1));
                  }
         int res = 0;
         for(int mask=0; mask < (1<<R); mask++)
            res = Math.max(res, R*C-(dp[C][mask][0]+Integer.bitCount(mask)));
         System.out.println(res);
      }
   }


import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.HashMap;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.PrintWriter;
import java.io.OutputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Alex
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskC {
        int BAD = 11111;
        int rows;
        int cols;
        HashMap<IntIntPair, Integer>[] mem;

        boolean contains(int mem, int index) {
            if(index < 0) return false;
            return ((mem >> index) & 1) == 1;
        }

        int add(int mem, int index) {
            if(((mem >> index) & 1) == 0) {
                mem += (1 << index);
            }
            return mem;
        }

        int size(int mem) {
            int res = 0;
            while(mem > 0) {
                if(mem % 2 == 1) res++;
                mem /= 2;
            }
            return res;
        }

        void test() {
            if(contains(5, 0) == false) throw new RuntimeException();
            if(contains(5, 1) == true) throw new RuntimeException();
            if(contains(5, -1) == true) throw new RuntimeException();
            if(contains(5, 2) == false) throw new RuntimeException();
            if(contains(5, 3) == true) throw new RuntimeException();
            if(add(0, 2) != 4) throw new RuntimeException();
            if(add(4, 0) != 5) throw new RuntimeException();
            if(add(5, 0) != 5) throw new RuntimeException();
            if(size(5) != 2) throw new RuntimeException();
        }

        int dp(int row, int remabove, int squareabove) {
            if(row == rows) {
                if(remabove == 0) return 0;
                return BAD;
            }
            if(mem[row].containsKey(new IntIntPair(remabove, squareabove)))
                return mem[row].get(new IntIntPair(remabove, squareabove));
            int res = BAD;
            int possibilities = 1 << cols;
            for(int poss = 0; poss < possibilities; poss++) {
                int have = 0;
                for(int j = 0; j < cols; j++)
                    if(((poss >> j) & 1) == 1) {
                        have += 1 << j;
                    }
                boolean works = true;
                for(int above = 0; above < cols; above++)
                    if(((remabove >> above) & 1) == 1) {
                        if(((have >> above) & 1) == 0) {
                            works = false;
                            break;
                        }
                    }
                if(works) {
                    int remhere = 0;
                    for(int j = 0; j < cols; j++) {
                        if(!contains(have, j - 1) && !contains(have, j) && !contains(have, j + 1) && !contains(squareabove, j)) {
                            remhere = add(remhere, j);
                        }
                    }
                    res = Math.min(res, size(have) + dp(row + 1, remhere, have));
                }
            }
            mem[row].put(new IntIntPair(remabove, squareabove), res);
            return res;
        }

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            test();
            int n = in.readInt(), m = in.readInt();
            cols = Math.min(n, m);
            rows = Math.max(n, m);
            mem = new HashMap[rows];
            for(int i = 0; i < mem.length; i++) mem[i] = new HashMap<>();
            int res = dp(0, 0, 0);
            out.printLine(cols * rows - res);
        }

    }

    static class IntIntPair implements Comparable<IntIntPair> {
        public final int first;
        public final int second;

        public IntIntPair(int first, int second) {
            this.first = first;
            this.second = second;
        }

        public boolean equals(Object o) {
            if(this == o) return true;
            if(o == null || getClass() != o.getClass()) return false;

            IntIntPair pair = (IntIntPair) o;

            return first == pair.first && second == pair.second;

        }

        public int hashCode() {
            int result = Integer.hashCode(first);
            result = 31 * result + Integer.hashCode(second);
            return result;
        }

        public String toString() {
            return "(" + first + "," + second + ")";
        }

        @SuppressWarnings({"unchecked"})
        public int compareTo(IntIntPair o) {
            int value = Integer.compare(first, o.first);
            if(value != 0) {
                return value;
            }
            return Integer.compare(second, o.second);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if(numChars == -1)
                throw new InputMismatchException();
            if(curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch(IOException e) {
                    throw new InputMismatchException();
                }
                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while(isSpaceChar(c))
                c = read();
            int sgn = 1;
            if(c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if(c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while(!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if(filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }
}


import java.util.*; //Scanner;
import java.io.PrintWriter; //PrintWriter

public class R229_Rocket_A
{
	public static void main(String[] args) {
		Scanner      in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		solve(in, out);
		out.close();
		in.close();
	}

	public static void solve(Scanner in, PrintWriter out)
	{
		String s = in.next();
		char prevC = s.charAt(0);
		int cnt = 0, contig = 1;
		for (int i = 1; i < s.length(); i++)
		{
			if (s.charAt(i) == prevC)
				contig++;
			else
			{
				if (contig % 2 == 0) cnt++;
				contig = 1;
				prevC = s.charAt(i);
			}
		}
		if (contig % 2 == 0) cnt++;

		out.println(cnt);
	}
}


import java.util.Scanner;

public class GeneticEngineering {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		String str = scn.nextLine();
		int count = 1;
		int os = 0;
		for (int i = 1; i < str.length(); i++) {
			if (str.charAt(i - 1) != str.charAt(i)) {
				if (count % 2 == 0) {
					os++;
					count = 1;
				}
			} else {
				count++;
			}
		}
		if (count % 2 == 0) {
			os++;
		}
		System.out.println(os);
	}
}


import java.util.*;
public  class Main{
	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		char arr[]=scan.next().toCharArray();
		int count=0;
		int i=0,j=0;
		int temp=0;
		int n=arr.length;
		while(i<n){
			j=i;
			temp=0;
			while(j<n && arr[j]==arr[i]){
				j++;
				temp++;
			}
			if(temp%2==0){
				count++;
			}
			i=j;
		}
		System.out.print(count);
	}
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String theDNA = sc.next();
        int wholeCounter = 0, tempCounter = 1;
        char previousCharacter = theDNA.charAt(0);
        for (int i = 1; i < theDNA.length(); i++) {
            if (previousCharacter == theDNA.charAt(i)) {
                tempCounter++;
                previousCharacter = theDNA.charAt(i);
                if (i != theDNA.length() - 1) {
                    if (theDNA.charAt(i + 1) != previousCharacter && tempCounter % 2 == 0) {
                        wholeCounter++;
                        tempCounter = 1;
                    }
                }else if(tempCounter % 2 == 0){
                    wholeCounter++;
                    tempCounter = 1;
                }
            } else if (previousCharacter != theDNA.charAt(i)) {
                previousCharacter = theDNA.charAt(i);
            }
        }
        System.out.println(wholeCounter);
    }
}


import java.util.*;
public class a {
public static void main(String[] args)
{
    Scanner input = new Scanner(System.in);
    String s = input.next();
    int count = 1, res = 0;
    for(int i = 1; i<s.length(); i++)
    {
        if(s.charAt(i) == s.charAt(i-1)) count++;
        else
        {
            if(count%2 == 0) res++;
            count = 1;
        }
    }
    if(count%2 == 0) res++;
    System.out.println(res);
}
}


import java.util.Scanner;

public class Genetic_Engineering {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		sc.close();
		int count = 0;
		char p = s.charAt(0);
		boolean even = false;
		for(int i=1; i<s.length(); i++) {
			even=!even;
			if(i==s.length()-1&&s.charAt(i)==p&&even) {
				count++;
			}
			if(s.charAt(i)!=p) {
				 p=s.charAt(i);
				 count+=!even?1:0;
				 even = false;
			}
		}
		System.out.println(count);
	}

}


import java.util.*;
public class Program
{
	public static void main (String[] args)
	{
		// your code goes here
		Scanner scn = new Scanner(System.in);
        String str = scn.nextLine();
        int slow = 0;
        int fast = 1;
        int count = 1;
        int ans = 0;
        while(fast<str.length())
        {
            char ch = str.charAt(slow);
            char ch1 = str.charAt(fast);
            //System.out.println(count);
            if(ch==ch1){
            	//System.out.println(ch + " " + ch1);
            	count++;

            }
            else{
            	////System.out.println("else " + count);
            	//System.out.println(ch + " " + ch1);
            	if(count%2==0){
                    ans++;
                    //System.out.println("if " + ans);
                }
                slow = fast;
                count = 1;
            }
            fast++;

        }
        if(count%2==0){
        	ans++;
        }
        System.out.println(ans);
	}
}


import java.util.*;
public class GeneticEngineering {

    public static void main(String args[]){
    	Scanner scan=new Scanner(System.in);
   		String s=scan.next();
   		int i=0,nbInsert=0,occ=1;

   			while(i<s.length()-1)
   			{
   				if (s.charAt(i)==s.charAt(i+1))
   					occ++;
   				else{
   					if(occ%2==0) nbInsert++;
   					occ=1;
   				}
   				i++;
   			}
   if(occ%2==0) nbInsert++;
   			System.out.println(nbInsert);

 }
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		String x = scan.next();
		char a = '.';
		int c=0,ca=1;
		for(int i=0;i<x.length();i++)
		{
			char b = x.charAt(i);
			if(a==b)ca++;
			else
			{
				a=b;
				if(ca%2==0)c++;
				ca=1;
			}
		}
		if(ca%2==0)c++;
		System.out.println(c);
	}

}


import java.io.*;
import java.util.*;

public class A {
	void run() {
		String s = in.next();
		char prev = 0;
		int len = 0;
		int ans = 0;
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == prev) {
				len++;
			} else {
				if (len > 0 && len % 2 == 0) {
					ans++;
				}
				prev = s.charAt(i);
				len = 1;
			}
		}
		if (len > 0 && len % 2 == 0) {
			ans++;
		}
		System.out.println(ans);
	}

	static boolean stdStreams = true;
	static String fileName = A.class.getSimpleName().replaceFirst("_.*", "").toLowerCase();
	static String inputFileName = fileName + ".in";
	static String outputFileName = fileName + ".out";
	static MyScanner in;
	static PrintWriter out;

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		BufferedReader br;
		if (stdStreams) {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
		} else {
			br = new BufferedReader(new FileReader(inputFileName));
			out = new PrintWriter(outputFileName);
		}
		in = new MyScanner(br);
		new A().run();
		br.close();
		out.close();
	}

	static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		MyScanner(BufferedReader br) {
			this.br = br;
		}

		void findToken() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
		}

		String next() {
			findToken();
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}
}


import java.util.Scanner;

public class GeneticEngineering {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String s = input.nextLine();
        // String s = "GTGAATTTCC";
        System.out.println(Genetic(s));
        input.close();
    }

    public static int Genetic(String s) {
        int n = 0;
        if (s.length() < 2) {
            return n;
        }
        char c = s.charAt(0);
        int i = 1;
        int count = 1;
        while (i < s.length()) {
            if (s.charAt(i) == c) {
                count++;
            } else {
                if (count % 2 == 0) {
                    n++;
                }
                c = s.charAt(i);
                count = 1;
            }
            i++;
        }
        if (count % 2 == 0) {
            n++;
        }
        return n;
    }
}


import java.io.*;
import java.util.*;
import java.lang.*;
import static java.lang.Math.*;

public class TaskA implements Runnable {
    long m = (int)1e9+7;
    PrintWriter w;
    InputReader c;
    final int MAXN = (int)1e6 + 100;
    public void run() {
        c = new InputReader(System.in);
        w = new PrintWriter(System.out);

        char s[] = c.next().toCharArray();
        int n = s.length;

        int res = 0;
        for(int i=0;i<n;i++){
            int t = 1;
            while (i!=n-1 && s[i]==s[i+1]){
                t++; i++;
            }
            if(t%2==0) res++;
        }
        w.println(res);

        w.close();
    }
    long gcd(long a, long b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }
    public static void sortbyColumn(int arr[][], int col){
        Arrays.sort(arr, new Comparator<int[]>()
        {
            public int compare(int[] o1, int[] o2){
                return(Integer.valueOf(o1[col]).compareTo(o2[col]));
            }
        });

    }
    public static class DJSet {
        public int[] upper;

        public DJSet(int n) {
            upper = new int[n];
            Arrays.fill(upper, -1);
        }

        public int root(int x) {
            return upper[x] < 0 ? x : (upper[x] = root(upper[x]));
        }

        public boolean equiv(int x, int y) {
            return root(x) == root(y);
        }

        public boolean union(int x, int y) {
            x = root(x);
            y = root(y);
            if (x != y) {
                if (upper[y] < upper[x]) {
                    int d = x;
                    x = y;
                    y = d;
                }
                upper[x] += upper[y];
                upper[y] = x;
            }
            return x == y;
        }
    }
    public static int[] radixSort(int[] f)    {
        int[] to = new int[f.length];
        {
            int[] b = new int[65537];
            for(int i = 0;i < f.length;i++)b[1+(f[i]&0xffff)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < f.length;i++)to[b[f[i]&0xffff]++] = f[i];
            int[] d = f; f = to;to = d;
        }
        {
            int[] b = new int[65537];
            for(int i = 0;i < f.length;i++)b[1+(f[i]>>>16)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < f.length;i++)to[b[f[i]>>>16]++] = f[i];
            int[] d = f; f = to;to = d;
        }
        return f;
    }
    public void printArray(int[] a){
        for(int i=0;i<a.length;i++)
            w.print(a[i]+" ");
        w.println();
    }
    public int[] scanArrayI(int n){
        int a[] = new int[n];
        for(int i=0;i<n;i++)
            a[i] = c.nextInt();
        return a;
    }
    public long[] scanArrayL(int n){
        long a[] = new long[n];
        for(int i=0;i<n;i++)
            a[i] = c.nextLong();
        return a;
    }
    public void printArray(long[] a){
        for(int i=0;i<a.length;i++)
            w.print(a[i]+" ");
        w.println();
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;
        private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars==-1)
                throw new InputMismatchException();

            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                }
                catch (IOException e) {
                    throw new InputMismatchException();
                }

                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        public int nextInt() {
            int c = read();

            while(isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;
            do {
                if(c<'0'||c>'9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            }
            while (!isSpaceChar(c));

            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return readString();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    public static void main(String args[]) throws Exception {
        new Thread(null, new TaskA(),"TaskA",1<<26).start();
    }
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class GeneticEngineering {
	public static void main(String[] args) {
		InputReader r = new InputReader(System.in);
		char[] arr = r.next().toCharArray();
		int res = 0;
		for (int i = 0; i < arr.length; i++) {
			int len = 1;
			while (i + 1 < arr.length && arr[i] == arr[i + 1]) {
				len++;
				i++;
			}
			if (len % 2 == 0)
				res++;
		}
		System.out.println(res);
	}

	static class InputReader {
		private BufferedReader reader;
		private StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}

		public InputReader(FileReader stream) {
			reader = new BufferedReader(stream);
			tokenizer = null;
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}
	}
}


import java.util.Scanner;

public class Solution {
    public static void main( String[] args ) {
        Scanner in = new Scanner(System.in);
        String s = "";
        try {
            s = in.nextLine();
        }
        catch (Exception e){
            e.printStackTrace();
        }
        in.close();

        System.out.println(get(s));
    }

    public static int get( String s ) {
        int ret = 0;
        int count = 1;
        for( int i = 0; i < s.length(); i++ ) {
            while( i + 1 < s.length() && s.charAt(i) == s.charAt(i+1) ) {
                count++;
                i++;
            }
            if( count % 2 == 0 ) {
                ret++;
            }
            count = 1;
        }
        return ret;
    }
}


import java.util.Scanner;

public class DNA {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int count = 1;
        int i = 0;
        int toPrint = 0;
        if(i + 1 == str.length()){
            System.out.println(0);
            System.exit(0);
        }
        while (i + 1 < str.length()) {
            if(str.charAt(i) == str.charAt(i + 1)){
                count++;
                if(i+2>=str.length()){
                    if(count%2 == 0){
                        toPrint++;
                    }
                }
            } else{
                if(count%2 == 0){
                    toPrint++;
                    count = 1;
                } else{
                    count = 1;
                }
            }
            i++;
        }
        if(i - 1 >=0){
            if(i == str.length()){
                if(str.charAt(i) != str.charAt(i -1)){
                    toPrint++;
                }
            }
        }
        System.out.println(toPrint);
    }
}


import java.util.*;
public class Solution
{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s = sc.nextLine();
        int l=s.length();
        int c=0,z,j;
        for(int i=0;i<(l-1);)
        {
            if(s.charAt(i)==s.charAt(i+1))
            {
                z=1;
                for(j=i;j<(l-1);j++)
                {

                    if(s.charAt(j)==s.charAt(j+1))
                    z++;
                    else if(j==(l-2) || s.charAt(j)!=s.charAt(j+1))
                    break;
                }
                if(z%2==0)
                ++c;

                i=j;
            }
            else
            i++;
        }
        System.out.println(c);
        sc.close();
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Task {
	public static void main(String[] args) {
		solve();
	}

	static void solve() {
		String s = nextString();
		int cnt = 1;
		int ans = 0;
		for (int i = 0; i < s.length() - 1; ++i) {
			if (s.charAt(i) == s.charAt(i + 1)) {
				cnt++;
			}

			if (s.charAt(i) != s.charAt(i + 1) || i + 1 == s.length() - 1) {
				if ((cnt & 1) == 0)
					ans++;
				cnt = 1;
			}
		}
		System.out.println(ans);
	}

	/************************************************************************************/
	static InputStream is = System.in;
	static private byte[] buffer = new byte[1024];
	static private int lenbuf = 0, ptrbuf = 0;

	static private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(buffer);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return buffer[ptrbuf++];
	}

	static private boolean isSpace(int c) {
		return !(c >= 33 && c <= 126);
	}

	static private int read() {
		int b;
		while ((b = readByte()) != -1 && isSpace(b))
			;
		return b;
	}

	static private double nextDouble() {
		return Double.parseDouble(nextString());
	}

	static private char nextChar() {
		return (char) read();
	}

	static private String nextString() {
		int b = read();
		StringBuilder sb = new StringBuilder();
		while (!(isSpace(b))) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	static private char[] nextString(int n) {
		char[] buf = new char[n];
		int b = read(), p = 0;
		while (p < n && !(isSpace(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	static private int nextInt() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	static private long nextLong() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	static private int[] nextAi(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	static private Integer[] nextAi1(int n) {
		Integer[] a = new Integer[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

}


import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int n = s.length();
		int count = 0, ans = 0;
		for(int i = 0; i<n; ){
			char c = s.charAt(i);
			int j = i;
			count=0;
			while(j < n && s.charAt(j) == c){
				count++;
				j++;
			}
			i = j;
			if(count % 2 == 0)
				ans++;
			// System.out.println(ans);
		}
		System.out.println(ans);
	}
}


import java.util.*;

public class GeneticEngineering {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);

		String str=sc.next();

		int counter=1,res=0;
		for(int i=0;i<(str.length()-1);i++)
		{
			if( str.charAt(i)==str.charAt(i+1) )
			{
				counter++;
			}
			else
			{
				if(counter%2==0)
				{
					res++;
					counter=1;
				}
				else
				{
					counter=1;
				}
			}
		}
		if(counter>1)
		{
			if(counter%2==0)
				res++;
		}

		System.out.println(res);

		sc.close();

	}

}


import java.util.Scanner;

public class GeneticEngineering {

	public static void main(String[] args) {
			Scanner scanner = new Scanner(System.in);
			String input = scanner.nextLine();
			int finalCount = 0;
			if(input!=null && !"".equals(input)){
				char[] nucleotides = input.toCharArray();
				char previous = ' ';
				int seqCounter = 1;
				for (char current : nucleotides) {
					if(current == previous){
						seqCounter++;
					}else{
						if(seqCounter%2 == 0){
							finalCount++;
							seqCounter = 1;
						}
					}
					previous = current;
				}
				if(seqCounter%2 == 0){
					finalCount++;
					seqCounter = 1;
				}
		}
			System.out.println(finalCount);

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;

public class Task391A {

	public static void main(String... args) throws NumberFormatException,
			IOException {
		Solution.main(System.in, System.out);
	}

	static class Scanner {

		private final BufferedReader br;
		private String[] cache;
		private int cacheIndex;

		Scanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
			cache = new String[0];
			cacheIndex = 0;
		}

		int nextInt() throws IOException {
			if (cacheIndex >= cache.length) {
				cache = br.readLine().split(" ");
				cacheIndex = 0;
			}
			return Integer.parseInt(cache[cacheIndex++]);
		}

		String next() throws IOException {
			if (cacheIndex >= cache.length) {
				cache = br.readLine().split(" ");
				cacheIndex = 0;
			}
			return cache[cacheIndex++];
		}

		void close() throws IOException {
			br.close();
		}

	}

	static class Solution {

		public static void main(InputStream is, OutputStream os)
				throws NumberFormatException, IOException {
			PrintWriter pw = new PrintWriter(os);
			Scanner sc = new Scanner(is);

			char dna[] = (sc.next() + "#").toCharArray();

			int prevCount = 1;
			int retVal = 0;

			for (int i = 1; i < dna.length; i++) {
				if (dna[i] == dna[i - 1]) {
					prevCount++;
				} else {
					if (prevCount % 2 == 0) {
						retVal++;
					}
					prevCount = 1;
				}
			}

			pw.println(retVal);

			pw.flush();
			sc.close();
		}
	}

}


import java.io.*;
import java.util.*;

public class Main
{

	public static void main(String args[]) throws NumberFormatException, IOException
	{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String s = br.readLine();
		if(s.length()==1)
		{
			System.out.println("0");
			return;
		}
		int j=0,count=0,len=0;
		for(int i=0;i<s.length();i++)
		{
			if(s.charAt(i)==s.charAt(j))
				len++;
			else
			{
				j=i;

				if(len%2==0)
				{
				count++;
				}
				len=1;

			}
		}
		if(len%2==0)
			count++;

		System.out.println(count);

	}
}


import java.util.*;
public class DATA {
	public static void main(String[]args)
	{
		Scanner s=new Scanner(System.in);
	     String a=s.next();
	     int[]k=new int[100];
	     int c=0;
	     int m=0;
	     char mt;
	     for(int i=0;i<a.length();i++)
	     {
	    char ms=a.charAt(i);
	    if(i+1==a.length())
	    	mt=48;
	    else
	    mt=a.charAt(i+1);
	    if(ms==mt)
	    {
	    	c++;
	    }
	    else
	    {
	    c++;
	    k[m++]=c;
	    c=0;
	    }
	    }
	     int result=0;
	     for(int i=0;i<m;i++)
	     {
	    	 if(k[i]%2==0)
	    		 result++;
	     }
	     System.out.print(result);

	}

}


import java.io.*;
import java.util.*;

public class R1A
{
    public static StringTokenizer st;
    public static void nextLine(BufferedReader br) throws IOException
    {
        st = new StringTokenizer(br.readLine());
    }

    public static String next()
    {
        return st.nextToken();
    }

    public static int nextInt()
    {
        return Integer.parseInt(st.nextToken());
    }

    public static long nextLong()
    {
        return Long.parseLong(st.nextToken());
    }

    public static double nextDouble()
    {
        return Double.parseDouble(st.nextToken());
    }

    public static void main(String[] args) throws IOException
    {
        long stime = System.currentTimeMillis();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        nextLine(br);
        String s = next();
        char q = s.charAt(0);
        int pos = 0;
        int sum = 0;
        for (int i = 1; i < s.length(); i++)
        {
            if (s.charAt(i) != q)
            {
                if ((i - pos) % 2 == 0)
                {
                    sum++;
                }
                pos = i;
                q = s.charAt(i);
            }
        }
        if ((s.length() - pos) % 2 == 0)
        {
            sum++;
        }
        System.out.println(sum);
    }
}


import java.util.*;
public class GeneticEngineering {

	public static void main(String[] args) {

		Scanner sc=new Scanner(System.in);
		String str=sc.next();

		int insert=0;

		for(int i=0;i<str.length();i++)
		{
			int count=1;
			while(i+1<str.length() && str.charAt(i)==str.charAt(i+1))
			{
				count++;
				i++;
			}
			if(count%2==0)
			{
				insert++;
			}

		}
		System.out.println(insert);

	}

}


import java.util.*;
public class Solution{
	public static void main(String args[]){
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		scanner.close();

		int res = 0;
		char currentChar=' ';
		int count = 0;
		for(int i=0; i<input.length(); i++){
			if(currentChar != input.charAt(i)){
				if(i!=0 && count % 2 == 0)
					res++;
				count = 1;
				currentChar = input.charAt(i);
			}else{
				count++;
			}
		}
		if(count % 2 == 0)
			res++;
		System.out.println(res);

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class A {

    public static void main(String[] args) {
        InputScanner is = new InputScanner();
        try{
            String s = is.next();
            char[] tab = s.toCharArray();
            char c = tab[0];
            int counter = 1;
            int result = 0;
            for (int i = 1; i < tab.length; i++) {
                if (tab[i]==c) counter++;
                else{
                    if (counter%2==0) result++;
                    counter = 1;
                    c = tab[i];
                }
            }
            if (counter%2==0) result++;
            System.out.println(result);
        } catch (IOException e){
            e.printStackTrace();
        }

    }

    static class InputScanner {

        BufferedReader br;
        StringTokenizer st;

        public InputScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() throws IOException {
            if (st == null || !st.hasMoreTokens()) {
                String line = br.readLine();
                st = new StringTokenizer(line);
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            String next = next();
            return Integer.parseInt(next);
        }

        public long nextLong() throws IOException {
            String next = next();
            return Long.parseLong(next);
        }
    }
}


import java.io.*;
import java.util.*;
import java.util.Map.*;
import java.lang.reflect.*;
import java.math.*;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Task solver = new A();
        solver.solve(1, in, out);
        out.close();
    }
}

interface Task {
    public void solve(int testNumber, InputReader in, OutputWriter out);
}

class A implements Task {

    public void solve(int testNumber, InputReader in, OutputWriter out){
        String str=in.next();
        int ret=0, n=str.length(), c=0;
        for (int i=1; i<n; i++) {
        	if (str.charAt(i)!=str.charAt(i-1)) {
        		ret+=c%2;
        		c=0;
        	}
        	else c++;
        }
        ret+=c%2;
        out.printLine(ret);
    }

}

class B implements Task {

	public void solve(int testNumber, InputReader in, OutputWriter out) {
        String str=in.next();
        StringBuilder ret=new StringBuilder();
        for (int i=0; i<str.length(); i++) {
        	char c=str.charAt(i);
        	if (c=='>') ret.append("1000");
        	else if (c=='<') ret.append("1001");
        	else if (c=='+') ret.append("1010");
        	else if (c=='-') ret.append("1011");
        	else if (c=='.') ret.append("1100");
        	else if (c==',') ret.append("1101");
        	else if (c=='[') ret.append("1110");
        	else ret.append("1111");
        }
        int n=0;
        for (int i=0; i<ret.length(); i++) n=(2*n+ret.charAt(i)-'0')%1000003;
        out.printLine(n);
    }

}

class C implements Task {

	public void solve(int testNumber, InputReader in, OutputWriter out){

    }

}

class D implements Task {

	public void solve(int testNumber, InputReader in, OutputWriter out){

    }

}

class E implements Task {

	public void solve(int testNumber, InputReader in, OutputWriter out){

	}

}

class F implements Task {

	public void solve (int testNumber, InputReader in, OutputWriter out) {

	}

}

class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1)
            return -1;
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long readLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            if (Character.isValidCodePoint(c))
                res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuilder buf = new StringBuilder();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r')
                buf.appendCodePoint(c);
            c = read();
        }
        return buf.toString();
    }

    public String readLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String readLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines)
            return readLine();
        else
            return readLine0();
    }

    public BigInteger readBigInteger() {
        try {
            return new BigInteger(readString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char readCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E')
                return res * Math.pow(10, readInt());
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return readString();
    }

    public SpaceCharFilter getFilter() {
        return filter;
    }

    public void setFilter(SpaceCharFilter filter) {
        this.filter = filter;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(char[] array) {
        writer.print(array);
    }

    public void print(Object...objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void print(int[] array) {
        for (int i = 0; i < array.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(array[i]);
        }
    }

    public void print(long[] array) {
        for (int i = 0; i < array.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(array[i]);
        }
    }

    public void printLine(int[] array) {
        print(array);
        writer.println();
    }

    public void printLine(long[] array) {
        print(array);
        writer.println();
    }

    public void printLine() {
        writer.println();
    }

    public void printLine(Object...objects) {
        print(objects);
        writer.println();
    }

    public void print(char i) {
        writer.print(i);
    }

    public void printLine(char i) {
        writer.println(i);
    }

    public void printLine(char[] array) {
        writer.println(array);
    }

    public void printFormat(String format, Object...objects) {
        writer.printf(format, objects);
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

    public void print(long i) {
        writer.print(i);
    }

    public void printLine(long i) {
        writer.println(i);
    }

    public void print(int i) {
        writer.print(i);
    }

    public void printLine(int i) {
        writer.println(i);
    }
}

interface Filter<T> {
	public boolean accept(T value);
}

interface Function<A, V> {
	public abstract V value(A argument);
}

class CollectionUtils {
	public static int[] toArray(Collection<Integer> collection) {
		int[] array = new int[collection.size()];
		int index = 0;
		for (int element : collection)
			array[index++] = element;
		return array;
	}

	public static List<Integer> range(int from, int to) {
		List<Integer> result = new ArrayList<Integer>(Math.max(from, to) - Math.min(from, to) + 1);
		if (to > from) {
			for (int i = from; i <= to; i++)
				result.add(i);
		} else {
			for (int i = from; i >= to; i--)
				result.add(i);
		}
		return result;
	}

	public static void rotate(List<Integer> list) {
		list.add(list.remove(0));
	}

	public static<T extends Comparable<T>> T minElement(Iterable<T> collection) {
		T result = null;
		for (T element : collection) {
			if (result == null || result.compareTo(element) > 0)
				result = element;
		}
		return result;
	}

	public static<T extends Comparable<T>> T maxElement(Iterable<T> collection) {
		T result = null;
		for (T element : collection) {
			if (result == null || result.compareTo(element) < 0)
				result = element;
		}
		return result;
	}

	public static<T> T minElement(Iterable<T> collection, Comparator<T> comparator) {
		T result = null;
		for (T element : collection) {
			if (result == null || comparator.compare(result, element) > 0)
				result = element;
		}
		return result;
	}

	public static<T> T maxElement(Iterable<T> collection, Comparator<T> comparator) {
		T result = null;
		for (T element : collection) {
			if (result == null || comparator.compare(result, element) < 0)
				result = element;
		}
		return result;
	}

	public static<T> List<T> asList(Iterable<T> iterable) {
		List<T> list = new ArrayList<T>();
		for (T element : iterable)
			list.add(element);
		return list;
	}

	public static<T> int count(Iterable<T> array, T sample) {
		int result = 0;
		for (T element : array) {
			if (element.equals(sample))
				result++;
		}
		return result;
	}

	public static<T> int count(Iterable<T> array, Filter<T> filter) {
		int result = 0;
		for (T element : array) {
			if (filter.accept(element))
				result++;
		}
		return result;
	}

	public static<T> List<T> filter(Iterable<T> sequence, Filter<T> filter) {
		List<T> result = new ArrayList<T>();
		for (T element : sequence) {
			if (filter.accept(element))
				result.add(element);
		}
		return result;
	}

	public static<A, V> List<V> apply(Iterable<A> sequence, Function<A, V> function) {
		List<V> result = new ArrayList<V>();
		for (A element : sequence)
			result.add(function.value(element));
		return result;
	}

	public static void main(String[] args) {
		System.out.println("Hello world!");
	}

}

class Pair<U, V> implements Comparable<Pair<U, V>> {
	public final U first;
	public final V second;

	public static<U, V> Pair<U, V> makePair(U first, V second) {
		return new Pair<U, V>(first, second);
	}

	private Pair(U first, V second) {
		this.first = first;
		this.second = second;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		Pair pair = (Pair) o;

		return !(first != null ? !first.equals(pair.first) : pair.first != null) && !(second != null ? !second.equals(pair.second) : pair.second != null);

	}

	@Override
	public int hashCode() {
		int result = first != null ? first.hashCode() : 0;
		result = 31 * result + (second != null ? second.hashCode() : 0);
		return result;
	}

	public Pair<V, U> swap() {
		return makePair(second, first);
	}

	@Override
	public String toString() {
		return "(" + first + "," + second + ")";
	}

	@SuppressWarnings({"unchecked"})
	public int compareTo(Pair<U, V> o) {
		int value = ((Comparable<U>)first).compareTo(o.first);
		if (value != 0)
			return value;
		return ((Comparable<V>)second).compareTo(o.second);
	}
}

abstract class ReadOnlyIterator<T> implements Iterator<T>  {
	public final void remove() {
		throw new UnsupportedOperationException();
	}
}

class IOUtils {
	public static Pair<Integer, Integer> readIntPair(InputReader in) {
		int first = in.readInt();
		int second = in.readInt();
		return Pair.makePair(first, second);
	}

	public static Pair<Long, Long> readLongPair(InputReader in) {
		long first = in.readLong();
		long second = in.readLong();
		return Pair.makePair(first, second);
	}

	public static int[] readIntArray(InputReader in, int size) {
		int[] array = new int[size];
		for (int i = 0; i < size; i++)
			array[i] = in.readInt();
		return array;
	}

	public static long[] readLongArray(InputReader in, int size) {
		long[] array = new long[size];
		for (int i = 0; i < size; i++)
			array[i] = in.readLong();
		return array;
	}

	public static double[] readDoubleArray(InputReader in, int size) {
		double[] array = new double[size];
		for (int i = 0; i < size; i++)
			array[i] = in.readDouble();
		return array;
	}

	public static String[] readStringArray(InputReader in, int size) {
		String[] array = new String[size];
		for (int i = 0; i < size; i++)
			array[i] = in.readString();
		return array;
	}

	public static char[] readCharArray(InputReader in, int size) {
		char[] array = new char[size];
		for (int i = 0; i < size; i++)
			array[i] = in.readCharacter();
		return array;
	}

	public static Pair<Integer, Integer>[] readIntPairArray(InputReader in, int size) {
		@SuppressWarnings({"unchecked"})
		Pair<Integer, Integer>[] result = new Pair[size];
		for (int i = 0; i < size; i++)
			result[i] = readIntPair(in);
		return result;
	}

	public static Pair<Long, Long>[] readLongPairArray(InputReader in, int size) {
		@SuppressWarnings({"unchecked"})
		Pair<Long, Long>[] result = new Pair[size];
		for (int i = 0; i < size; i++)
			result[i] = readLongPair(in);
		return result;
	}

	public static void readIntArrays(InputReader in, int[]... arrays) {
		for (int i = 0; i < arrays[0].length; i++) {
			for (int j = 0; j < arrays.length; j++)
				arrays[j][i] = in.readInt();
		}
	}

	public static void readLongArrays(InputReader in, long[]... arrays) {
		for (int i = 0; i < arrays[0].length; i++) {
			for (int j = 0; j < arrays.length; j++)
				arrays[j][i] = in.readLong();
		}
	}

	public static void readDoubleArrays(InputReader in, double[]...arrays) {
		for (int i = 0; i < arrays[0].length; i++) {
			for (int j = 0; j < arrays.length; j++)
				arrays[j][i] = in.readDouble();
		}
	}

	public static char[][] readTable(InputReader in, int rowCount, int columnCount) {
		char[][] table = new char[rowCount][];
		for (int i = 0; i < rowCount; i++)
			table[i] = readCharArray(in, columnCount);
		return table;
	}

	public static int[][] readIntTable(InputReader in, int rowCount, int columnCount) {
		int[][] table = new int[rowCount][];
		for (int i = 0; i < rowCount; i++)
			table[i] = readIntArray(in, columnCount);
		return table;
	}

	public static double[][] readDoubleTable(InputReader in, int rowCount, int columnCount) {
		double[][] table = new double[rowCount][];
		for (int i = 0; i < rowCount; i++)
			table[i] = readDoubleArray(in, columnCount);
		return table;
	}

	public static long[][] readLongTable(InputReader in, int rowCount, int columnCount) {
		long[][] table = new long[rowCount][];
		for (int i = 0; i < rowCount; i++)
			table[i] = readLongArray(in, columnCount);
		return table;
	}

	public static String[][] readStringTable(InputReader in, int rowCount, int columnCount) {
		String[][] table = new String[rowCount][];
		for (int i = 0; i < rowCount; i++)
			table[i] = readStringArray(in, columnCount);
		return table;
	}

	public static String readText(InputReader in) {
		StringBuilder result = new StringBuilder();
		while (true) {
			int character = in.read();
			if (character == '\r')
				continue;
			if (character == -1)
				break;
			result.append((char) character);
		}
		return result.toString();
	}

	public static void readStringArrays(InputReader in, String[]... arrays) {
		for (int i = 0; i < arrays[0].length; i++) {
			for (int j = 0; j < arrays.length; j++)
				arrays[j][i] = in.readString();
		}
	}

	public static void printTable(OutputWriter out, char[][] table) {
		for (char[] row : table)
			out.printLine(new String(row));
	}
}

interface IntComparator {
    public static final IntComparator DEFAULT = new IntComparator() {
        public int compare(int first, int second) {
            if (first < second)
                return -1;
            if (first > second)
                return 1;
            return 0;
        }
    };

	public static final IntComparator REVERSE = new IntComparator() {
		public int compare(int first, int second) {
			if (first < second)
				return 1;
			if (first > second)
				return -1;
			return 0;
		}
	};

	public int compare(int first, int second);
}

class ReverseComparator<T extends Comparable<T>> implements Comparator<T> {
	public int compare(T o1, T o2) {
		return o2.compareTo(o1);
	}
}

class Angle {
	public final Point o;
	public final Point a;
	public final Point b;

	public Angle(Point o, Point a, Point b) {
		this.o = o;
		this.a = a;
		this.b = b;
	}

	public double value() {
		double ab = a.distance(b);
		double ao = a.distance(o);
		double bo = b.distance(o);
		return Math.acos((ao * ao + bo * bo - ab * ab) / (2 * ao * bo));
	}

}

class Circle {
	public final Point center;
	public final double radius;

	public Circle(Point center, double radius) {
		this.center = center;
		this.radius = radius;
	}

	public boolean contains(Point point) {
		return center.distance(point) < radius + GeometryUtils.epsilon;
	}

	public boolean strictContains(Point point) {
		return center.distance(point) < radius - GeometryUtils.epsilon;
	}

    public Point[] findTouchingPoints(Point point) {
        double distance = center.distance(point);
        if (distance < radius - GeometryUtils.epsilon)
            return new Point[0];
        if (distance < radius + GeometryUtils.epsilon)
            return new Point[]{point};
        Circle power = new Circle(point, Math.sqrt((distance - radius) * (distance + radius)));
        return intersect(power);
    }

    public Point[] intersect(Circle other) {
        double distance = center.distance(other.center);
        if (distance > radius + other.radius + GeometryUtils.epsilon || Math.abs(radius - other.radius) > distance + GeometryUtils.epsilon)
            return new Point[0];
        double p = (radius + other.radius + distance) / 2;
        double height = 2 * Math.sqrt(p * (p - radius) * (p - other.radius) * (p - distance)) / distance;
        double l1 = Math.sqrt(radius * radius - height * height);
        double l2 = Math.sqrt(other.radius * other.radius - height * height);
        if (radius * radius + distance * distance < other.radius * other.radius)
            l1 = -l1;
        if (radius * radius > distance * distance + other.radius * other.radius)
            l2 = -l2;
        Point middle = new Point((center.x * l2 + other.center.x * l1) / (l1 + l2),
            (center.y * l2 + other.center.y * l1) / (l1 + l2));
        Line line = center.line(other.center).perpendicular(middle);
        return line.intersect(this);
    }
}

class GeometryUtils {
	public static double epsilon = 1e-8;

	public static double fastHypot(double...x) {
		if (x.length == 0)
			return 0;
		else if (x.length == 1)
			return Math.abs(x[0]);
		else {
			double sumSquares = 0;
			for (double value : x)
				sumSquares += value * value;
			return Math.sqrt(sumSquares);
		}
	}

    public static double fastHypot(double x, double y) {
        return Math.sqrt(x * x + y * y);
    }

	public static double fastHypot(double[] x, double[] y) {
		if (x.length == 0)
			return 0;
		else if (x.length == 1)
			return Math.abs(x[0]- y[0]);
		else {
			double sumSquares = 0;
			for (int i = 0; i < x.length; i++) {
				double diff = x[i] - y[i];
				sumSquares += diff * diff;
			}
			return Math.sqrt(sumSquares);
		}
	}

	public static double fastHypot(int[] x, int[] y) {
		if (x.length == 0)
			return 0;
		else if (x.length == 1)
			return Math.abs(x[0]- y[0]);
		else {
			double sumSquares = 0;
			for (int i = 0; i < x.length; i++) {
				double diff = x[i] - y[i];
				sumSquares += diff * diff;
			}
			return Math.sqrt(sumSquares);
		}
	}

	public static double missileTrajectoryLength(double v, double angle, double g) {
		return (v * v * Math.sin(2 * angle)) / g;
	}

	public static double sphereVolume(double radius) {
		return 4 * Math.PI * radius * radius * radius / 3;
	}

	public static double triangleSquare(double first, double second, double third) {
		double p = (first + second + third) / 2;
		return Math.sqrt(p * (p - first) * (p - second) * (p - third));
	}

	public static double canonicalAngle(double angle) {
		while (angle > Math.PI)
			angle -= 2 * Math.PI;
		while (angle < -Math.PI)
			angle += 2 * Math.PI;
		return angle;
	}

	public static double positiveAngle(double angle) {
		while (angle > 2 * Math.PI - GeometryUtils.epsilon)
			angle -= 2 * Math.PI;
		while (angle < -GeometryUtils.epsilon)
			angle += 2 * Math.PI;
		return angle;
	}
}

class Line {
	public final double a;
	public final double b;
	public final double c;

	public Line(Point p, double angle) {
		a = Math.sin(angle);
		b = -Math.cos(angle);
		c = -p.x * a - p.y * b;
	}

	public Line(double a, double b, double c) {
		double h = GeometryUtils.fastHypot(a, b);
		this.a = a / h;
		this.b = b / h;
		this.c = c / h;
	}

	public Point intersect(Line other) {
		if (parallel(other))
			return null;
		double determinant = b * other.a - a * other.b;
		double x = (c * other.b - b * other.c) / determinant;
		double y = (a * other.c - c * other.a) / determinant;
		return new Point(x, y);
	}

	public boolean parallel(Line other) {
		return Math.abs(a * other.b - b * other.a) < GeometryUtils.epsilon;
	}

	public boolean contains(Point point) {
		return Math.abs(value(point)) < GeometryUtils.epsilon;
	}

	public Line perpendicular(Point point) {
		return new Line(-b, a, b * point.x - a * point.y);
	}

	public double value(Point point) {
		return a * point.x + b * point.y + c;
	}

	public Point[] intersect(Circle circle) {
		double distance = distance(circle.center);
		if (distance > circle.radius + GeometryUtils.epsilon)
			return new Point[0];
		Point intersection = intersect(perpendicular(circle.center));
		if (Math.abs(distance - circle.radius) < GeometryUtils.epsilon)
			return new Point[]{intersection};
		double shift = Math.sqrt(circle.radius * circle.radius - distance * distance);
		return new Point[]{new Point(intersection.x + shift * b, intersection.y - shift * a),
			new Point(intersection.x - shift * b, intersection.y + shift * a)};
	}

	public double distance(Point center) {
		return Math.abs(value(center));
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		Line line = (Line) o;

		if (!parallel(line)) return false;
		if (Math.abs(a * line.c - c * line.a) > GeometryUtils.epsilon || Math.abs(b * line.c - c * line.b) > GeometryUtils.epsilon) return false;

		return true;
	}
}

class Point implements Comparable<Point> {
	public static final Point ORIGIN = new Point(0, 0);
	public final double x;
	public final double y;

	public int compareTo(Point other) {
        int value = Double.compare(this.x, other.x);
        if (value != 0)
            return value;
        return Double.compare(this.y, other.y);
    }

	@Override
	public String toString() {
		return "(" + x + ", " + y + ")";
	}

	public Point(double x, double y) {
		this.x = x;
		this.y = y;
	}

	public Line line(Point other) {
		if (equals(other))
			return null;
		double a = other.y - y;
		double b = x - other.x;
		double c = -a * x - b * y;
		return new Line(a, b, c);
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		Point point = (Point) o;

		return Math.abs(x - point.x) <= GeometryUtils.epsilon && Math.abs(y - point.y) <= GeometryUtils.epsilon;
	}

	@Override
	public int hashCode() {
		int result;
		long temp;
		temp = x != +0.0d ? Double.doubleToLongBits(x) : 0L;
		result = (int) (temp ^ (temp >>> 32));
		temp = y != +0.0d ? Double.doubleToLongBits(y) : 0L;
		result = 31 * result + (int) (temp ^ (temp >>> 32));
		return result;
	}

	public double distance(Point other) {
		return GeometryUtils.fastHypot(x - other.x, y - other.y);
	}

	public double distance(Line line) {
		return Math.abs(line.a * x + line.b * y + line.c);
	}

	public double value() {
		return GeometryUtils.fastHypot(x, y);
	}

	public double angle() {
		return Math.atan2(y, x);
	}

	public static Point readPoint(InputReader in) {
		double x = in.readDouble();
		double y = in.readDouble();
		return new Point(x, y);
	}

	public Point rotate(double angle) {
		double nx = x * Math.cos(angle) - y * Math.sin(angle);
		double ny = y * Math.cos(angle) + x * Math.sin(angle);
		return new Point(nx, ny);
	}
}

class Polygon {
	public final Point[] vertices;
	private Segment[] sides;

	public Polygon(Point...vertices) {
		this.vertices = vertices.clone();
	}

	public double square() {
		double sum = 0;
		for (int i = 1; i < vertices.length; i++)
			sum += (vertices[i].x - vertices[i - 1].x) * (vertices[i].y + vertices[i - 1].y);
		sum += (vertices[0].x - vertices[vertices.length - 1].x) * (vertices[0].y + vertices[vertices.length - 1].y);
		return Math.abs(sum) / 2;
	}

	public Point center() {
		double sx = 0;
		double sy = 0;
		for (Point point : vertices) {
			sx += point.x;
			sy += point.y;
		}
		return new Point(sx / vertices.length, sy / vertices.length);
	}

    public static boolean over(Point a, Point b, Point c) {
        return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y) < -GeometryUtils.epsilon;
    }

    private static boolean under(Point a, Point b, Point c) {
        return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y) > GeometryUtils.epsilon;
    }

    public static Polygon convexHull(Point[] points) {
        if (points.length == 1)
            return new Polygon(points);
        Arrays.sort(points);
        Point left = points[0];
        Point right = points[points.length - 1];
        List<Point> up = new ArrayList<Point>();
        List<Point> down = new ArrayList<Point>();
        for (Point point : points) {
            if (point == left || point == right || !under(left, point, right)) {
                while (up.size() >= 2 && under(up.get(up.size() - 2), up.get(up.size() - 1), point))
                    up.remove(up.size() - 1);
                up.add(point);
            }
            if (point == left || point == right || !over(left, point, right)) {
                while (down.size() >= 2 && over(down.get(down.size() - 2), down.get(down.size() - 1), point))
                    down.remove(down.size() - 1);
                down.add(point);
            }
        }
        Point[] result = new Point[up.size() + down.size() - 2];
        int index = 0;
        for (Point point : up)
            result[index++] = point;
        for (int i = down.size() - 2; i > 0; i--)
            result[index++] = down.get(i);
        return new Polygon(result);
    }

	public boolean contains(Point point) {
		return contains(point, false);
	}

    public boolean contains(Point point, boolean strict) {
		for (Segment segment : sides()) {
			if (segment.contains(point, true))
				return !strict;
		}
        double totalAngle = GeometryUtils.canonicalAngle(Math.atan2(vertices[0].y - point.y, vertices[0].x - point.x) -
			Math.atan2(vertices[vertices.length - 1].y - point.y, vertices[vertices.length - 1].x - point.x));
        for (int i = 1; i < vertices.length; i++) {
            totalAngle += GeometryUtils.canonicalAngle(Math.atan2(vertices[i].y - point.y, vertices[i].x - point.x) -
				Math.atan2(vertices[i - 1].y - point.y, vertices[i - 1].x - point.x));
        }
        return Math.abs(totalAngle) > Math.PI;
    }

	public Segment[] sides() {
		if (sides == null) {
			sides = new Segment[vertices.length];
			for (int i = 0; i < vertices.length - 1; i++)
				sides[i] = new Segment(vertices[i], vertices[i + 1]);
			sides[sides.length - 1] = new Segment(vertices[vertices.length - 1], vertices[0]);
		}
		return sides;
	}

	public static double triangleSquare(Point a, Point b, Point c) {
		return Math.abs((a.x - b.x) * (a.y + b.y) + (b.x - c.x) * (b.y + c.y) + (c.x - a.x) * (c.y + a.y)) / 2;
	}

	public double perimeter() {
		double result = vertices[0].distance(vertices[vertices.length - 1]);
		for (int i = 1; i < vertices.length; i++)
			result += vertices[i].distance(vertices[i - 1]);
		return result;
	}
}

class Ray {
	public final Point base;
	public final Line line;
	private final Line perpendicular;

	public Ray(Point base, double direction) {
		this.base = base;
		line = new Line(base, direction);
		this.perpendicular = line.perpendicular(base);
	}

	public Ray(Point base, Point other) {
		this.base = base;
		line = base.line(other);
		this.perpendicular = line.perpendicular(base);
	}

	public boolean contains(Point point) {
		return line.contains(point) && perpendicular.value(point) > -GeometryUtils.epsilon;
	}

	public double distance(Point point) {
		if (perpendicular.value(point) > -GeometryUtils.epsilon)
			return line.distance(point);
		return base.distance(point);
	}
}

class Segment {
	public final Point a;
	public final Point b;
    private double distance = Double.NaN;
    private Line line = null;

	public Segment(Point a, Point b) {
		this.a = a;
		this.b = b;
	}

	public double length() {
        if (Double.isNaN(distance))
            distance = a.distance(b);
        return distance;
	}

	public double distance(Point point) {
		double length = length();
		double left = point.distance(a);
		if (length < GeometryUtils.epsilon)
			return left;
		double right = point.distance(b);
		if (left * left > right * right + length * length)
			return right;
		if (right * right > left * left + length * length)
			return left;
		return point.distance(line());
	}

	public Point intersect(Segment other, boolean includeEnds) {
		Line line = line();
		Line otherLine = other.a.line(other.b);
		if (line.parallel(otherLine))
			return null;
		Point intersection = line.intersect(otherLine);
		if (contains(intersection, includeEnds) && other.contains(intersection, includeEnds))
			return intersection;
		else
			return null;
	}

	public boolean contains(Point point, boolean includeEnds) {
		if (a.equals(point) || b.equals(point))
			return includeEnds;
		if (a.equals(b))
			return false;
		Line line = line();
		if (!line.contains(point))
			return false;
		Line perpendicular = line.perpendicular(a);
		double aValue = perpendicular.value(a);
		double bValue = perpendicular.value(b);
		double pointValue = perpendicular.value(point);
		return aValue < pointValue && pointValue < bValue || bValue < pointValue && pointValue < aValue;
	}

	public Line line() {
        if (line == null)
            line = a.line(b);
		return line;
	}

	public Point middle() {
		return new Point((a.x + b.x) / 2, (a.y + b.y) / 2);
	}

	public Point[] intersect(Circle circle) {
		Point[] result = line().intersect(circle);
		if (result.length == 0)
			return result;
		if (result.length == 1) {
			if (contains(result[0], true))
				return result;
			return new Point[0];
		}
		if (contains(result[0], true)) {
			if (contains(result[1], true))
				return result;
			return new Point[]{result[0]};
		}
		if (contains(result[1], true))
			return new Point[]{result[1]};
		return new Point[0];
	}

	public Point intersect(Line line) {
		Line selfLine = line();
		Point intersect = selfLine.intersect(line);
		if (intersect == null)
			return null;
		if (contains(intersect, true))
			return intersect;
		return null;
	}

	public double distance(Segment other) {
		Line line = line();
		Line otherLine = other.line();
		Point p = line == null || otherLine == null ? null : line.intersect(otherLine);
		if (p != null && contains(p, true) && other.contains(p, true))
			return 0;
		return Math.min(Math.min(other.distance(a), other.distance(b)), Math.min(distance(other.a), distance(other.b)));
	}
}

class Vector {
	public final double x;
	public final double y;
	public final Point point;

	public Vector(double x, double y) {
		this.x = x;
		this.y = y;
		point = new Point(x, y);
	}

	public Vector(Point point) {
		this.x = point.x;
		this.y = point.y;
		this.point = point;
	}

	public Vector(Point from, Point to) {
		this(to.x - from.x, to.y - from.y);
	}

	public double angleTo(Vector other) {
		return GeometryUtils.canonicalAngle(other.point.angle() - point.angle());
	}

	public double length() {
		return point.value();
	}

	public double angle() {
		return point.angle();
	}
}

class Heap {
	private IntComparator comparator;
	private int size = 0;
	private int[] elements;
	private int[] at;

	public Heap(int maxElement) {
		this(10, maxElement);
	}

	public Heap(IntComparator comparator, int maxElement) {
		this(10, comparator, maxElement);
	}

	public Heap(int capacity, int maxElement) {
		this(capacity, IntComparator.DEFAULT, maxElement);
	}

	public Heap(int capacity, IntComparator comparator, int maxElement) {
		this.comparator = comparator;
		elements = new int[capacity];
		at = new int[maxElement];
		Arrays.fill(at, -1);
	}

	public int getSize() {
		return size;
	}

    public void setComparator(IntComparator comparator) {
        this.comparator = comparator;
    }

    public boolean isEmpty() {
		return size == 0;
	}

	public int add(int element) {
		ensureCapacity(size + 1);
		elements[size] = element;
		at[element] = size;
		shiftUp(size++);
		return at[element];
	}

	public void shiftUp(int index) {
//		if (index < 0 || index >= size)
//			throw new IllegalArgumentException();
		int value = elements[index];
		while (index != 0) {
			int parent = (index - 1) >>> 1;
			int parentValue = elements[parent];
			if (comparator.compare(parentValue, value) <= 0) {
				elements[index] = value;
				at[value] = index;
				return;
			}
			elements[index] = parentValue;
			at[parentValue] = index;
			index = parent;
		}
		elements[0] = value;
		at[value] = 0;
	}

	public void shiftDown(int index) {
		if (index < 0 || index >= size)
			throw new IllegalArgumentException();
		while (true) {
			int child = (index << 1) + 1;
			if (child >= size)
				return;
			if (child + 1 < size && comparator.compare(elements[child], elements[child + 1]) > 0)
				child++;
			if (comparator.compare(elements[index], elements[child]) <= 0)
				return;
			swap(index, child);
			index = child;
		}
	}

	public int getIndex(int element) {
		return at[element];
	}

	private void swap(int first, int second) {
		int temp = elements[first];
		elements[first] = elements[second];
		elements[second] = temp;
		at[elements[first]] = first;
		at[elements[second]] = second;
	}

	private void ensureCapacity(int size) {
		if (elements.length < size) {
			int[] oldElements = elements;
			elements = new int[Math.max(2 * elements.length, size)];
			System.arraycopy(oldElements, 0, elements, 0, this.size);
		}
	}

	public int peek() {
		if (isEmpty())
			throw new IndexOutOfBoundsException();
		return elements[0];
	}

	public int poll() {
		if (isEmpty())
			throw new IndexOutOfBoundsException();
		int result = elements[0];
		at[result] = -1;
		if (size == 1) {
			size = 0;
			return result;
		}
		elements[0] = elements[--size];
		at[elements[0]] = 0;
		shiftDown(0);
		return result;
	}

    public void clear() {
        size = 0;
		Arrays.fill(at, -1);
    }
}

class BooleanMatrix {
	public final boolean[][] data;
	public final int rowCount;
	public final int columnCount;

	public BooleanMatrix(int rowCount, int columnCount) {
		this.rowCount = rowCount;
		this.columnCount = columnCount;
		this.data = new boolean[rowCount][columnCount];
	}

	public static BooleanMatrix add(BooleanMatrix first, BooleanMatrix second) {
		BooleanMatrix result = new BooleanMatrix(first.rowCount, first.columnCount);
		for (int i = 0; i < result.rowCount; i++) {
			for (int j = 0; j < result.columnCount; j++) {
				result.data[i][j] = first.data[i][j] || second.data[i][j];
			}
		}
		return result;
	}

	public static BooleanMatrix multiply(BooleanMatrix first, BooleanMatrix second) {
		BooleanMatrix result = new BooleanMatrix(first.rowCount, second.columnCount);
		for (int i = 0; i < first.rowCount; i++) {
			for (int j = 0; j < second.rowCount; j++) {
				for (int k = 0; k < second.columnCount; k++)
					result.data[i][k] |= first.data[i][j] && second.data[j][k];
			}
		}
		return result;
	}

	public static BooleanMatrix identityMatrix(int size) {
		BooleanMatrix result = new BooleanMatrix(size, size);
		for (int i = 0; i < size; i++)
			result.data[i][i] = true;
		return result;
	}

	public BooleanMatrix power(int exponent) {
		if (exponent == 0)
			return identityMatrix(rowCount);
		if (exponent == 1)
			return this;
		BooleanMatrix result = power(exponent >> 1);
		result = multiply(result, result);
		if ((exponent & 1) == 1)
			result = multiply(result, this);
		return result;
	}
}

class DoubleUtils {
	public static double sumGeometricProgression(double p, double q) {
		return p / (1 - q);
	}
}

class FastFourierTransform {
	public static void fft(double[] a, double[] b, boolean invert) {
		int count = a.length;
		for (int i = 1, j = 0; i < count; i++) {
			int bit = count >> 1;
			for (; j >= bit; bit >>= 1)
				j -= bit;
			j += bit;
			if (i < j) {
				double temp = a[i];
				a[i] = a[j];
				a[j] = temp;
				temp = b[i];
				b[i] = b[j];
				b[j] = temp;
			}
		}
		for (int len = 2; len <= count; len <<= 1) {
			int halfLen = len >> 1;
			double angle = 2 * Math.PI / len;
			if (invert)
				angle = -angle;
			double wLenA = Math.cos(angle);
			double wLenB = Math.sin(angle);
			for (int i = 0; i < count; i += len) {
				double wA = 1;
				double wB = 0;
				for (int j = 0; j < halfLen; j++) {
					double uA = a[i + j];
					double uB = b[i + j];
					double vA = a[i + j + halfLen] * wA - b[i + j + halfLen] * wB;
					double vB = a[i + j + halfLen] * wB + b[i + j + halfLen] * wA;
					a[i + j] = uA + vA;
					b[i + j] = uB + vB;
					a[i + j + halfLen] = uA - vA;
					b[i + j + halfLen] = uB - vB;
					double nextWA = wA * wLenA - wB * wLenB;
					wB = wA * wLenB + wB * wLenA;
					wA = nextWA;
				}
			}
		}
		if (invert) {
			for (int i = 0; i < count; i++) {
				a[i] /= count;
				b[i] /= count;
			}
		}
	}

	public static long[] multiply(long[] a, long[] b) {
		int resultSize = Integer.highestOneBit(Math.max(a.length, b.length) - 1) << 2;
		resultSize = Math.max(resultSize, 1);
		double[] aReal = new double[resultSize];
		double[] aImaginary = new double[resultSize];
		double[] bReal = new double[resultSize];
		double[] bImaginary = new double[resultSize];
		for (int i = 0; i < a.length; i++)
			aReal[i] = a[i];
		for (int i = 0; i < b.length; i++)
			bReal[i] = b[i];
		fft(aReal, aImaginary, false);
		if (a == b) {
			System.arraycopy(aReal, 0, bReal, 0, aReal.length);
			System.arraycopy(aImaginary, 0, bImaginary, 0, aImaginary.length);
		} else
			fft(bReal, bImaginary, false);
		for (int i = 0; i < resultSize; i++) {
			double real = aReal[i] * bReal[i] - aImaginary[i] * bImaginary[i];
			aImaginary[i] = aImaginary[i] * bReal[i] + bImaginary[i] * aReal[i];
			aReal[i] = real;
		}
		fft(aReal, aImaginary, true);
		long[] result = new long[resultSize];
		for (int i = 0; i < resultSize; i++)
			result[i] = Math.round(aReal[i]);
		return result;
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;

public class GeneticEngineering {

	public static void main(String [] args) throws Exception
	{
		BufferedReader buffReader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		String dna = buffReader.readLine();
		int c=1;
		int res =0;
		for(int i=1;i<dna.length();i++)
		{
			if(Character.toString(dna.charAt(i)).equals(Character.toString(dna.charAt(i-1))))
			{
				c++;
			}
			else{
				if(c%2==0)
					{
					res+=1;
					c=1;
					}
			}
		}
		if(c!=1 && c%2==0)
		{
			res+=1;
		}
		out.println(res);
		out.flush();

	}
}


import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
	public void solve(int testNumber, InputReader in, PrintWriter out) {
		char[] s = in.next().toCharArray();
		int cnt = 0;
		int res = 0;
		for (int i = 0; i < s.length; i++) {
			++cnt;
			if (i == s.length - 1 || s[i] != s[i + 1]) {
				if (cnt % 2 == 0) {
					++res;
				}
				cnt = 0;
			}
		}
		out.println(res);
	}
}

class InputReader {
	public BufferedReader reader;
	public StringTokenizer tokenizer;

	public InputReader(InputStream stream) {
		reader = new BufferedReader(new InputStreamReader(stream));
	}

	public String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	}


import java.util.Scanner;
public class Main
{
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		String str;
		str=sc.next();
		str=str+" ";
		int i, pos=0, c=0, ans=0;
		char ch, cp;
		for(i=1;i<str.length();i++)
		{
			ch=str.charAt(i);
			cp=str.charAt(pos);
			if(ch!=cp)
			{
				pos=i;
				if((c+1)%2==0)
				   ans++;
				   c=0;
			}
			else
				c++;
		}
		System.out.println(ans);
	}
}


/*
* To change this template, choose Tools | Templates and open the template in
* the editor.
*/

import java.io.*;

import java.util.*;

public class Task extends ASolver {

    char[] dna;

    public static void main(String[] args) throws IOException {
        Task task = new Task();
        task.init();
        task.readData();
        task.writeData(task.solve());
    }

    @Override
    public void init() {
        super.init();
    }

    @Override
    public boolean readData() {
        try {

            dna = next().toCharArray();

        } catch (Exception ex) {
            System.out.println(ex.getCause());
            System.out.println(ex.getMessage());
            return false;
        }
        return true;
    }

    public long solve() throws IOException {

        int result = 0;

        for (int i = 0; i < dna.length; ) {

            int equalsCount = 0;
            int j = i + 1;

            while (j < dna.length && dna[j] == dna[i]) {
                equalsCount++;
                j++;
            }

            i = j;

            if (equalsCount % 2 != 0) {
                result++;
            }

        }

        return result;
    }
}

abstract class ASolver {

    protected StringTokenizer tokens;
    protected BufferedReader input;
    protected PrintWriter output;

    public void init() {
        input = new BufferedReader(new InputStreamReader(System.in));
    }

    public abstract boolean readData();

    public void writeData(String result) {
        System.out.println(result);
    }

    public void writeData(int result) {
        System.out.println(result);
    }

    public void writeData(long result) {
        System.out.println(result);
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public byte nextByte() throws IOException {
        return Byte.parseByte(next());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public String next() throws IOException {
        while (tokens == null || !tokens.hasMoreTokens()) {
            tokens = new StringTokenizer(input.readLine());
        }
        return tokens.nextToken();
    }

    public String nextPoints() throws IOException {
        while (tokens == null || !tokens.hasMoreTokens()) {
            tokens = new StringTokenizer(input.readLine(), "\n");
        }
        return tokens.nextToken();
    }

    public long infinityImitator(long a, long b) {
        if (a == Long.MIN_VALUE) {
            return Long.MIN_VALUE;
        } else {
            return a + b;
        }
    }

    public int infinityImitator(int a, int b) {
        if (a == Integer.MIN_VALUE) {
            return Integer.MIN_VALUE;
        } else {
            return a + b;
        }
    }

    /*
     * public long max(long... a) { long result = Long.MIN_VALUE; for (int i =
     * 0; i < a.length; i++) { result = Math.max(result, a[i]); } return result;
     * }
     */
    public int indexMax(int... a) {
        int result = 0;
        int index = -1;
        int length = a.length;
        for (int i = 0; i < length; i++) {
            if (a[i] > result) {
                result = a[i];
                index = i;
            }
        }
        return index;
    }

    public int indexMax(long... a) {
        long result = 0;
        int index = -1;
        int length = a.length;
        for (int i = 0; i < length; i++) {
            if (a[i] > result) {
                result = a[i];
                index = i;
            }
        }
        return index;
    }

    public int max(int... a) {
        int result = Integer.MIN_VALUE;
        for (int i = 0; i < a.length; i++) {
            result = Math.max(result, a[i]);
        }
        return result;
    }

    public long max(long... a) {
        long result = Integer.MIN_VALUE;
        for (int i = 0; i < a.length; i++) {
            result = Math.max(result, a[i]);
        }
        return result;
    }

    public int nod(int[] array) {
        int nod = array[0];

        for (int i = 1; i < array.length; i++) {
            nod = nod(nod, array[i]);
        }

        return nod;
    }

    private int nod(int m, int n) {

        int result = 0;

        if (m == 0) {
            return n;
        }

        if (n == 0) {
            return m;
        }

        if (n == m) {
            return m;
        }

        if (m == 1 || n == 1) {
            return 1;
        }

        int mDel = m % 2;
        int nDel = n % 2;

        if (mDel != 0 && nDel != 0) {
            return nod((Math.max(m, n) - Math.min(m, n)) / 2, Math.min(m, n));
        } else if (mDel == 0 && nDel != 0) {
            return nod(m / 2, n);
        } else if (mDel != 0 && nDel == 0) {
            return nod(m, n / 2);
        } else {
            return 2 * nod(m / 2, n / 2);
        }
    }
}


import java.util.*;
import java.io.*;

public class Solution {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        char[] input = br.readLine().trim().toCharArray();

        int n = input.length;
        int ans = 0;
        int count = 1;
        for(int i= 0;i<n-1;i++){
            if(input[i] == input[i+1]){
                count++;
            }
            else{
                if(count%2 == 0)ans++;

                count= 1;
            }
        }
        if(count%2 == 0)ans++;

        System.out.println(ans);

    }

}


import java.io.*;
import java.util.*;
import java.math.*;

public class Main {

    public static void main(String[] args) throws java.lang.Exception {
        //Reader pm =new Reader();
        Scanner pm = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        String s = pm.next();
        int n = s.length();
        int sum = 1;
        int ans = 0;
        for(int i=1;i<n;i++){
            if(s.charAt(i) == s.charAt(i-1)){
                sum++;
            }
            else {
                if(sum%2 == 0)
                    ans++;
                sum = 1;
            }
            if(i == n-1){
                if(sum%2 == 0)
                    ans++;
            }
        }
        System.out.println(ans);
    }

    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
}