#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int ans = MOD, tmp = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      tmp++;
    }
  }
  ans = min(ans, tmp);
  tmp = 0;
  for (int i = 0; i < n; i++) {
    if (i < n - i - 1) {
      if (s[i] == '#') {
        tmp++;
      }
      if (s[n - i - 1] == '.') {
        tmp++;
      }
    } else {
      break;
    }
  }
  ans = min(ans, tmp);
  cout << ans << endl;
  return 0;
}
