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 Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
//        InputStream inputStream = new FileInputStream("dijkstra.in");
        OutputStream outputStream = System.out;
//        OutputStream outputStream = new FileOutputStream("dijkstra.out");


//        Path path = Paths.get(URI.create("file:///foo/bar/Main.java"));
//        System.out.print(path.getName(200));

//        Path p = Paths.get("/foo/bar/Main.java");
//        for (Path e : p) {
//            System.out.println(e);
//        }

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Answer solver = new Answer();
        solver.solve(in, out);
        out.close();
    }
}

class Answer {
    private final int INF = (int) (1e9 + 7);

    private int minstart(int[] tmp, int xstart) {
        int n = tmp.length;
        int[] a = Arrays.copyOf(tmp, n);

//        for (int i = 0; i < n; i++) {
//            System.out.print(a[i] + " ");
//        }
//        System.out.println();

        int x = xstart;
        int ans = 0;
        for (int i = 0; i < n - 1; i++) {
            if (x == a[i]) {
                x = (x + 1) % 2;
                continue;
            }
            if (x == a[i + 1]) {
                a[i + 1] = a[i];
                a[i] = x;
                ans++;
                x = (x + 1) % 2;
                continue;
            }

            a[i] = x;
            ans++;
            x = (x + 1) % 2;
        }
        if (a[n - 1] != x) {
            ans++;
        }
        return ans;
    }

    public void solve(InputReader in, PrintWriter out) throws IOException {
        int n = in.nextInt();
        String s = in.next();

        if (n == 1) {
            out.print("0");
            return;
        }

        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == 'b') {
                a[i] = 0;
            } else {
                a[i] = 1;
            }
        }

        int ans = Math.min(minstart(a, 0), minstart(a, 1));

//        int x = a[1];
//        for (int i = 1; i < n - 1; i++) {
//            if (x == a[i]) {
//                x = (x + 1) % 2;
//                continue;
//            }
//            if (x == a[i + 1]) {
//                a[i + 1] = a[i];
//                a[i] = x;
//                ans++;
//                x = (x + 1) % 2;
//                continue;
//            }
//
//            a[i] = x;
//            ans++;
//            x = (x + 1) % 2;
//        }
//        if (a[n - 1] != x) {
//            ans++;
//        }

        out.print(ans);
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    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 int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }
}
