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