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