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