#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  int ANS1 = 0;
  int ANS2 = 0;
  cin >> N;
  cin >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      ANS1++;
    }
  }
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      ANS2++;
      S[i + 1] = '#';
    }
  }
  cout << min(ANS1, ANS2) << endl;
}
