#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;
  while (cin >> a >> c) {
    int x = 0, y = 0;
    for (int i = 0; i < c.length(); i++) {
      if (c[i] == '#') {
        x++;
      }
      if (c[i] == '.') {
        y++;
      }
    }
    if (c[0] == '.' && y != 0) y--;
    if (c[c.length() - 1] == '#' && x != 0) x--;
    int minn = min(x, y);
    cout << minn << endl;
  }
  return 0;
}
