#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int idx = 0;
  for (int i = (0); i < (N); ++i) {
    if (S[i] == '#') {
      idx = i;
      if (S[min(i + 1, N - 1)] == '.')
        break;
      else {
        idx = min(i + 1, N - 1);
      }
    }
  }
  S = S.substr(idx);
  int white = count(S.begin(), S.end(), '.');
  int black = count(S.begin(), S.end(), '#');
  int ans = min(white, black);
  cout << ans << endl;
  return 0;
}
