#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, right_count = 0, left_count = 0;
  string s;
  cin >> n >> s;
  bool start = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') start = true;
    if (start) {
      if (s[i] == '.') ++right_count;
    } else {
      if (s[i] == '.') ++left_count;
    }
  }
  if ((right_count + left_count) == 0) {
    cout << 0 << endl;
    return 0;
  }
  if (right_count == 0) right_count = n;
  if (left_count == 0) left_count = n;
  cout << min(right_count, left_count) << endl;
  return 0;
}
