#include <bits/stdc++.h>
using namespace std;
long long gar(long long a, long long b) { return b == 0 ? a : gar(b, a % b); }
int main() {
  int a, b;
  string c, c1, c2;
  while (cin >> a >> c) {
    int x = 0, y = 0;
    c1 = c2 = c;
    for (int i = 0; i < c.length() - 1; i++) {
      if (c1[i] == '#' && c1[i + 1] == '.') {
        c1[i + 1] = '#';
        x++;
      }
    }
    for (int i = c.length(); i > 0; i--) {
      if (c2[i] == '.' && c2[i - 1] == '#') {
        c2[i - 1] = '.';
        y++;
      }
    }
    int minn = min(x, y);
    cout << minn << endl;
  }
  return 0;
}
