#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int start = 0;
  int end = n - 1;
  while (s[start] == '.' and start < n) {
    start++;
    if (start == n) break;
  }
  while (s[end] == '#' and end >= 0) {
    end--;
    if (end == -1) break;
  }
  if (start == n or end == -1) {
    cout << 0;
  } else {
    int count = 0;
    for (int i = start; i <= end; i++) {
      if (s[i] == '#') count++;
    }
    cout << min(end - start + 1 - count, count);
  }
  return 0;
}
