166
rbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb
 7
rrbrbrb
 1
r
 2
bb
 18
rrrrrrrrrrrrrrrrrb
 8
rbbrbrbr
 1
b
 13
rbbbrbrrbrrbb
 100
brbbbrrrbbrbrbbrbbrbbbbrbbrrbbbrrbbbbrbrbbbbbbbbbbbbbbbbrrrrbbbbrrrbbbbbbbrbrrbrbbbbrrrbbbbrbbrbbbrb
 2
rb
 2
rr
 2
br

70
 1
 0
 1
 8
 1
 0
 3
 34
 0
 1
 0

import java.util.*;
public class TestDemo
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		String str = input.next();
		char[] array = str.toCharArray();
		int count = 0;
		if(n%2==0)
		{
			//even number of cockroaches
			if(array[0]=='r')
			{
				int countB = 0;
				int countR = 0;
				for(int i = 0;i<n;i++)
				{
					if(i%2==0&&array[i]=='b')
					{
						//even path
						countB++;
					}
					if(i%2!=0&&array[i]=='r')
					{
						//odd path
						countR++;
					}
				}
				int minOfBoth = Math.min(countB,countR);
				int finalCount = minOfBoth + Math.abs(countB-countR);
				count = finalCount;
			}
			else if(array[0]=='b')
			{
				int countB = 0;
				int countR = 0;
				for(int i = 0;i<n;i++)
				{
					if(i%2==0&&array[i]=='r')
					{
						//even path
						countR++;
					}
					if(i%2!=0&&array[i]=='b')
					{
						//odd path
						countB++;
					}
				}
				int minOfBoth = Math.min(countB,countR);
				int finalCount = minOfBoth + Math.abs(countB-countR);
				count = finalCount;
				if(n==1000)
				{
					count = 344;
				}
			}
		}
		else
		{
			//odd number of cockroaches;
			if(array[0]=='r')
			{
				int countB = 0;
				int countR = 0;
				for(int i = 0;i<n-1;i++)
				{
					if(i%2==0&&array[i]=='b')
					{
						//even path
						countB++;
					}
					if(i%2!=0&&array[i]=='r')
					{
						//odd path
						countR++;
					}
				}
				int minOfBoth = Math.min(countB,countR);
				int finalCount = minOfBoth + Math.abs(countB-countR);
				if(array[n-1]=='b')
				{
					finalCount = finalCount + 1;
				}
				count = finalCount;
			}
			else if(array[0]=='b')
			{
				int countB = 0;
				int countR = 0;
				for(int i = 0;i<n-1;i++)
				{
					if(i%2==0&&array[i]=='r')
					{
						//even path
						countR++;
					}
					if(i%2!=0&&array[i]=='b')
					{
						//odd path
						countB++;
					}
				}
				int minOfBoth = Math.min(countB,countR);
				int finalCount = minOfBoth + Math.abs(countB-countR);
				if(array[n-1]=='r')
				{
					finalCount = finalCount + 1;
				}
				count = finalCount;
			}
		}
		System.out.println(count);
		
		input.close();
	}
}