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.*;
import java.io.*;
import java.math.BigInteger;
public class Main {
	public static long mod= (long) (1e9 +7);
	static HashMap<Integer,Integer> hmap= new HashMap<>();
	public static void main(String args[])
	{
			InputReader s= new InputReader(System.in);
			OutputStream outputStream= System.out;
			PrintWriter out= new PrintWriter(outputStream);
			int n= s.nextInt();
			String str1;
			char str[]= new char[n];
			int arr[]= new int[n];
			str1= s.next();
			if(n==1) out.println("0");
			else{
			for(int i=0;i<n;i++){
				str[i]= str1.charAt(i);
				if(str[i]=='r') arr[i]=1;
				else arr[i]=0;
			}
			int data[]= new int[n];
			int countswaps=0;
			int countchange=0;
			int ans=arr[0];
			for(int i=1;i<n;i++){
				if(i%2==0){
					if(arr[i]!=ans){
						data[i]=1;
					}
				}
				else{
					if(arr[i]==ans) data[i]=1;
				}
			}
			for(int i=1;i<n-1;i++){
				if(data[i]==1 && data[i+1]==1) {
					countswaps++;
					i++;
				}
				else if(data[i]==1 && data[i+1]!=1){
					countchange++;
				}
			}
			if(data[n-2]==0 && data[n-1]==1) countchange++;
			int min1= countswaps+countchange;
			int data1[]= new int[n];
			int countswaps1=0;
			int countchange1=0;
			int ans1;
			if(arr[0]==1) ans1=0;
			else ans1=1;
			for(int i=0;i<n;i++){
				if(i%2==0){
					if(arr[i]!=ans1){
						data1[i]=1;
					}
				}
				else{
					if(arr[i]==ans1) data1[i]=1;
				}
			}
			for(int i=0;i<n-1;i++){
				if(data1[i]==1 && data1[i+1]==1) {
					countswaps1++;
					i++;
				}
				else if(data1[i]==1 && data1[i+1]!=1){
					countchange1++;
				}
			}
			if(data1[n-2]==0 && data1[n-1]==1) countchange1++;
			int min2= countswaps1+countchange1;
			//out.print(min1+" "+min2);
			out.println(Math.min(min1,min2));
			}
	       out.close();
	}
	static class InputReader {

	    public BufferedReader reader;
	    public StringTokenizer tokenizer;
 
	    public InputReader(InputStream inputstream) {
	      reader = new BufferedReader(new InputStreamReader(inputstream));
	      tokenizer = null;
	    }
	    
	    public String nextLine(){
	    	String fullLine=null;
	    	while (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	              fullLine=reader.readLine();
	            } catch (IOException e) {
	              throw new RuntimeException(e);
	            }
	            return fullLine;
	          }
	          return fullLine;
	    }
		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 long nextLong() {
		      return Long.parseLong(next());
		    }
	    public int nextInt() {
	      return Integer.parseInt(next());
	    }
	  }
	static class Pair implements Comparable<Pair>
	{
		int f,s;
		Pair(int ii, int cc)
		{
			f=ii;
			s=cc;
		}
		
		public int compareTo(Pair o) 
		{
			return Long.compare(this.f, o.f);
		}
		
	}
	public static int gcd(int number1, int number2) {  
		if(number2 == 0){
			return number1;
		} 
		return gcd(number2, number1%number2); 
	}
	public static int combinations(int n,int r){
		if(n==r) return 1;
		if(r==1) return n;
		if(r==0) return 1;
		return combinations(n-1,r)+ combinations(n-1,r-1);
	}
	public static long binomialCoeff(int n, int k)
	{
	    long C[][]= new long[n+1][k+1];
	    int i, j;
	 
	    // Caculate value of Binomial Coefficient in bottom up manner
	    for (i = 0; i <= n; i++)
	    {
	        for (j = 0; j <= Math.min(i, k); j++)
	        {
	            // Base Cases
	            if (j == 0 || j == i)
	                C[i][j] = 1;
	 
	            // Calculate value using previosly stored values
	            else
	                C[i][j] = C[i-1][j-1] + C[i-1][j];
	        }
	    }
	 
	    return C[n][k];
	}
	public static int expo(int a, int b){
	    if (b==1)
	        return a;
	    if (b==2)
	        return a*a;

	    if (b%2==0){
	            return expo(expo(a,b/2),2);
	    }
	    else{
	        return a*expo(expo(a,(b-1)/2),2);
	    }
	}
	
	public static void sieve(int N){
		int arr[]= new int[N+1];
		for(int i=2;i<Math.sqrt(N);i++){
			if(arr[i]==0){
				for(int j= i*i;j<= N;j= j+i){
					arr[j]=1;
				}
			}
		}
		// All the i for which arr[i]==0 are prime numbers.
		for(int i=2;i<=N;i++){
			if(arr[i]==0)
				hmap.put(i,1);
		}
	}
}