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

#include<bits/stdc++.h>
#include <ext/numeric>
using namespace std;
#define sc(a) scanf("%d",&a)
#define sc2(a,b) scanf("%d%d",&a,&b)
#define sc3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define sc4(a,b,c,d) scanf("%d%d%d%d",&a,&b,&c,&d)
#define scd(a) scanf("%lf",&a)
#define scd2(a,b) scanf("%lf",&a,&b)
#define scd3(a,b,c) scanf("%lf%lf%lf",&a,&b,&c)
#define scd4(a,b,c,d) scanf("%lf%lf%lf%lf",&a,&b,&c,&d)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ALL(x) x.begin(), x.end()
#define BUFF ios::sync_with_stdio(false);
#define endl "\n"
#define power(a,x) __gnu_cxx::power(a, x)
#define forN(i,n) for(int i=0;i<n;i++)
#define eps 1e-5
#define INF INT_MAX
#define gcd(a,b) __gcd(a,b)

typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vector<int> >vvi;
char str[100010];
char str2[100010];
int main()
{
    int n;
    sc(n);
    scanf("%s",str);
    strcpy(str2,str);
    int m=INF;
    int r=0;
    for(int i=0;i<n-1;i++)
    {
        if(i%2)
        {
            if(str[i]=='r'&&str[i+1]=='b')
            {
                swap(str[i],str[i+1]);
                r++;
            }
        }
        else
        {
            if(str[i]=='b'&&str[i+1]=='r')
            {
                swap(str[i],str[i+1]);
                r++;
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        if(i%2)
        {
            if(str[i]=='r')
            {
                r++;
            }
        }
        else
        {
            if(str[i]=='b')
            {
                r++;
            }
        }
    }
    m=r;
    r=0;
    for(int i=0;i<n-1;i++)
    {
        if(i%2==0)
        {
            if(str2[i]=='r'&&str2[i+1]=='b')
            {
                swap(str2[i],str2[i+1]);
                r++;
            }
        }
        else
        {
            if(str2[i]=='b'&&str2[i+1]=='r')
            {
                swap(str2[i],str2[i+1]);
                r++;
            }
        }
    }
    for(int i=0;i<n;i++)
    {
        if(i%2==0)
        {
            if(str2[i]=='r')
            {
                r++;
            }
        }
        else
        {
            if(str2[i]=='b')
            {
                r++;
            }
        }
    }
    m=min(m,r);
    printf("%d\n",m);
    return 0;
}
