#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  int max = 0;
  int ans = 0;
  cin >> N >> S;
  int state = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      state = 1;
      if (i != N - 1) {
        max++;
      }
    } else {
      if (state == 1) {
        ans++;
      }
    }
  }
  cout << min(max, ans) << endl;
  return 0;
}
