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