#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int black = 0;
  int white = 0;
  string s;
  int ans = 0;
  bool flag = true;
  cin >> n >> s;
  int start;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#' && flag) {
      flag = false;
      start = i + 1;
    } else if (s[i] == '.') {
      white++;
    } else {
      start++;
    }
  }
  if (flag) {
    cout << 0 << endl;
  } else if (start > white) {
    cout << white << endl;
  } else {
    cout << start << endl;
  }
}
