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