/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	static int edgeCount(int n) {
		return Integer.bitCount(n ^ (n >> 1));
	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		int a = Integer.parseInt("00000000000000000000000000001010", 2);
		int b = Integer.parseInt("00000000000000000000000000001001", 2);
		int c = Integer.parseInt("01010101010101010101010101010101", 2);
		System.out.println(edgeCount(a));
		System.out.println(edgeCount(b));
		System.out.println(edgeCount(c));
	}
}