#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans1 = 0;
  int ans2 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      for (int j = i + 1; j < n; j++) {
        if (s[j] == '.') ans1++;
      }
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') ans2++;
  }
  cout << min(ans1, ans2) << endl;
}
