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.*;
/**
 * Author:-Milap Shah
 * College:-DA-IICT
 */
public class Main {

    public static void main(String[] args) {
        InputReader s = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        /*My code starts here.*/
        Calc cl = new Calc();
        int test = s.nextInt();
        String str = s.readString();
        StringBuilder sb1,sb2;
        sb1 = new StringBuilder("");
        sb2 = new StringBuilder("");
        
        for(int i=0;i<test;i++)
        {
        	if(i%2 == 0)
        	{
        		sb1.append("r");
            	sb2.append("b");
        	}
        	else
        	{
        		sb2.append("r");
            	sb1.append("b");
        		
        	}

        }
        out.println(Math.min(cl.func(str,sb1.toString(),str.length()),
        		cl.func(str,sb2.toString(),str.length())));
        
//        out.println(Math.min(cl.editDistDP(str,sb1.toString(),str.length(),sb1.length())
//                ,cl.editDistDP(str,sb2.toString(),str.length(),sb2.length())
//                ));
        /*My code ends here.*/
        out.close();
    }
    
    static class Node {
		ArrayList <Long>arr;

		public Node(){
			this.arr = new ArrayList<Long>();
		}

	}
    
    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}
class Calc{
	static int min(int x,int y,int z)
    {
        if (x < y && x <z) return x;
        if (y < x && y < z) return y;
        else return z;
    }
	static int editDistDP(String str1, String str2, int m, int n)
    {
        // Create a table to store results of subproblems
        int dp[][] = new int[m+1][n+1];
        int vv = 0,prev = 0;
        // Fill d[][] in bottom up manner
        for (int i=0; i<=m; i++)
        {
            for (int j=0; j<=n; j++)
            {
                // If first string is empty, only option is to
                // isnert all characters of second string
                if (i==0)
                    dp[i][j] = j;  // Min. operations = j
      
                // If second string is empty, only option is to
                // remove all characters of second string
                else if (j==0)
                    dp[i][j] = i; // Min. operations = i
      
                // If last characters are same, ignore last char
                // and recur for remaining string
                else if (str1.charAt(i-1) == str2.charAt(j-1) )
                    dp[i][j] = dp[i-1][j-1];
                
                else if(i >= 2 && str1.charAt(i-1)!=str1.charAt(i-2))
                {
                	dp[i][j] =  dp[i-1][j-1];
//                	j++;
                }
                // If last character are different, consider all
                // possibilities and find minimum
                else
                { 
                	dp[i][j] = 1 +  dp[i-1][j-1];
                	
//                	if(min(dp[i][j-1],  dp[i-1][j],dp[i-1][j-1]) == dp[i-1][j-1])
                	
                }
//                System.out.println("i =  "+i+" j = "+ j +" dp = "+ dp[i][j]);
                
            }
        }
  
        return dp[m][n];
    }
	
	public int func(String str1,String str2,int m)
	{
		int i=0,j=0;
		int ans = 0;
		while(i < m)
		{
			if(str1.charAt(i) == str2.charAt(j))
			{
			i++;
			j++;
			}
			else
			{
				if(i<(m-1) && str1.charAt(i) != str1.charAt(i+1))
				{
					ans++;
					i+=2;
					j+=2;
				}
				else
				{
					i++;
					j++;
					ans++;
				}
			}
			
		}
		
		return ans;
	}
}