module Main where

import Data.List
import Control.Monad
import Debug.Trace
 
readTuple :: Read a  => IO (a, a)
readTuple = do
    [f, s] <- readLs
    pure (f, s)

readLs :: Read a => IO [a]
readLs = fmap read . words <$> getLine

solve :: String -> Int
solve tiles = foldr (\elem acc -> if elem then acc + 1 else acc) 0 $ shouldConvert <$> zip [0..] tiles where
    firstNumber = head tiles
    shouldConvert (0, value) = False
    shouldConvert (index, value) = if index `mod` 2 == 0 then
        value /= firstNumber 
        else
            value == firstNumber


main = do
    tiles <- getLine
    print $ solve tiles


