#include <bits/stdc++.h>
int main(void) {
  int a;
  int N;
  char stone1[200000];
  char stone2[200000];
  int x = 0, y = 0;
  int result;
  scanf("%d", &N);
  scanf("%s", stone1);
  scanf("%s", stone2);
  for (a = 0; a < N - 1; a++) {
    if (stone1[a] == '#' && stone1[a + 1] == '.') {
      stone1[a + 1] == '#';
      x++;
    }
    if (stone2[a] == '#' && stone2[a + 1] == '.') {
      stone1[a] == '.';
      y;
    }
  }
  if (x >= y)
    result = x;
  else
    result = y;
  printf("%d", result);
  return 0;
}
