#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int i_tmp;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') i_tmp = i;
    break;
  }
  int cnt_b = 0, cnt_w = 0;
  for (int i = i_tmp + 1; i < n; i++) {
    if (s[i] == '.')
      cnt_w++;
    else
      cnt_b++;
  }
  if (cnt_w > cnt_b)
    cout << cnt_b + i_tmp << endl;
  else
    cout << cnt_w << endl;
}
