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