#include <bits/stdc++.h>
using namespace std;
long long f(long long x, long long y) {
  if (x > y) {
    return y;
  } else {
    return x;
  }
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string t = s;
  long long count = 0;
  long long count2 = 0;
  if (s.size() <= 2) {
    if (s == "#.") {
      cout << 1 << endl;
    } else {
      cout << 0 << endl;
    }
  } else {
    for (long long i = 0; i < s.size(); i++) {
      if (s[i] == '#') {
        for (long long j = i; j < s.size(); j++) {
          if (s[j] == '.') {
            count++;
          }
        }
        break;
      }
    }
    for (long long i = 0; i < t.size(); i++) {
      if (t[i] == '#') {
        count2++;
      }
      count2 = f(count2, t.size() - count2);
    }
    cout << f(count, count2) << endl;
  }
}
