#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, res = 0;
  int black = 0, white = 0;
  int flag = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#') flag = 1;
    if (flag == 0) continue;
    if (S[i] == '#')
      ++black;
    else if (S[i] == '.')
      ++white;
  }
  res = min(black, white);
  cout << res << endl;
}
