#include <bits/stdc++.h>
using namespace std;
long long int powk(long long int a, long long int n) {
  long long int r = 1;
  for (long long int i = 0; i < n; i++) {
    r *= a;
  }
  return r;
}
int main() {
  long long int n;
  string s;
  cin >> n >> s;
  long long int t1 = 00;
  bool f = false;
  for (long long int i = 0; i < n; i++) {
    if (!f && s[i] == '.') {
      f = true;
      t1++;
    } else if (f && s[i] == '.') {
      t1++;
    }
  }
  long long int t2 = 0, t3 = 0;
  for (long long int i = n - 1; i > 0; i--) {
    if (s[i] == '#') {
      t2++;
    } else {
      t3++;
    }
  }
  long long int ans = min({t1, t2, t3});
  cout << ans;
  return 0;
}
