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