#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, black = 0, white = 0, endb = 0;
  cin >> N;
  vector<char> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
    if (S.at(i) == '#')
      black++;
    else
      white++;
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S.at(i) == '#')
      endb++;
    else
      break;
  }
  int64_t ans = min(min(black - endb, white), min(black, white));
  cout << ans << endl;
}
