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.io.*;
import java.util.*;
public class B {
	static int [][] mem;
	static char [] a;
	static int n;
	public static void main(String[]args)throws Throwable{
		PrintWriter pw=new PrintWriter(System.out,true);
		MyScanner sc=new MyScanner();
		n=sc.nextInt();
		a=sc.next().toCharArray();
		mem=new int [n][3];
		for(int i=0;i<n;i++)
			Arrays.fill(mem[i], -1);
		pw.println(dp(0, 0));
		pw.flush();
		pw.close();
	}
	
	public static int dp(int i,int last){
		
		if(i==n){
			return 0;
		}
		
		if(mem[i][last]!=-1)
			return mem[i][last];
		
		int ans=(int) (1e9);
		if(last!=1){
			if(a[i]=='r')
				ans=Math.min(ans,dp(i+1, 1));
			else{
				ans=Math.min(ans,1+dp(i+1, 1));
				
				if(i<n-1 && a[i+1]=='r')
					ans=Math.min(ans,1+dp(i+2,2));
			}
		}
		if(last!=2){
			if(a[i]=='b')
				ans=Math.min(ans,dp(i+1, 2));
			else{
				ans=Math.min(ans,1+dp(i+1, 2));
				
				if(i<n-1 && a[i+1]=='b')
					ans=Math.min(ans,1+dp(i+2,1));
			}
		}
		return mem[i][last]=ans;
	}
	
	static class MyScanner {
	      BufferedReader br;
	      StringTokenizer st;
	 
	      public MyScanner() {
	         br = new BufferedReader(new InputStreamReader(System.in));
	      }
	 
	      String next() {
	          while (st == null || !st.hasMoreElements()) {
	              try {
	                  st = new StringTokenizer(br.readLine());
	              } catch (IOException e) {
	                  e.printStackTrace();
	              }
	          }
	          return st.nextToken();
	      }
	 
	      int nextInt() {
	          return Integer.parseInt(next());
	      }
	 
	      long nextLong() {
	          return Long.parseLong(next());
	      }
	 
	      double nextDouble() {
	          return Double.parseDouble(next());
	      }
	 
	      String nextLine(){
	          String str = "";
		  try {
		     str = br.readLine();
		  } catch (IOException e) {
		     e.printStackTrace();
		  }
		  return str;
	      }

	   }
}
