#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S, S1, S2;
  cin >> N;
  cin >> S;
  S1 = S;
  S2 = S;
  int res1 = 0;
  int res2 = 0;
  int res = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S1[i] == char('#')) {
      if (S1[i + 1] == char('.')) {
        S1[i + 1] = char('#');
        res1++;
      }
    }
    if (S2[i] == char('.')) {
      if (S2[i + 1] == char('#')) {
        S2[i + 1] = char('.');
        res2++;
      }
    }
    res = min(res1, res2);
  }
  cout << res << endl;
  return 0;
}
