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