#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long gcd(long long x, long long y) {
  long long r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
long long lcm(long long x, long long y) {
  x /= gcd(x, y);
  return (x * y);
}
int main() {
  long long n;
  string s;
  cin >> n >> s;
  long long max1 = 0, max2 = 0;
  string t = s;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      max1++;
      s[i] = '.';
    }
  }
  for (int i = 0; i < n - 1; i++) {
    if (t[i] == '#' && t[i + 1] == '.') {
      t[i + 1] = '#';
      max2++;
    }
  }
  cout << min(max1, max2) << endl;
  return 0;
}
