#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 28);
int n;
string s;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> s;
  s = s.c_str();
  int bl = 0;
  int bl1[n];
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      bl++;
    }
    bl1[i] = bl;
  }
  int j = 0;
  int st;
  while (j < n) {
    if (s[j] == '#') {
      st = j;
      break;
    }
    j++;
  }
  int m = min(bl, n - st - bl);
  cout << m << "\n";
}
