#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int N;
  int cnt1 = 0;
  int cnt2 = 0;
  int cnt_white = 0;
  int cnt_black;
  string S;
  cin >> N;
  cin >> S;
  int white = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[N - i - 1] == '.') {
      cnt_white++;
      white++;
    } else {
      cnt1 += white;
      white = 0;
    }
  }
  cnt_black = N - cnt_white;
  int black = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '#') {
      black++;
    } else {
      break;
    }
  }
  cnt2 = cnt_black - black;
  cout << min({cnt1, cnt2, cnt_white, cnt_black}) << endl;
}
