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