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