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