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