#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
vector<string> a(2);
for (int i = 0; i < 2; i++)
{
cin >> a[i];
}
int ans = 0;
int segments = 0;
int prv = -1;
for (int i = 0; i < n; i++)
{
if (a[0][i] == a[1][i])
ans += a[0][i] == 'B';
else
{
if (prv == -1 || a[0][i] != a[0][prv])
segments++;
prv = i;
}
}
if (segments)
ans += segments / 2 + 1;
cout << ans << "\n";
return 0;
}