#include <bits/stdc++.h>
using namespace std;
int b[200005], w[200005];
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  if (n == 2) {
    if (s[0] == '#' && s[1] == '.')
      cout << 1 << endl;
    else
      cout << 0 << endl;
    return 0;
  }
  int f = 0, l = n - 1;
  while (s[f] == '.') f++;
  while (s[l] == '#') l--;
  int a1 = 0, a2 = 0;
  for (int i = f; i <= l; i++) {
    if (s[i] == '#') a1++;
  }
  a2 = min(a1, l - f - a1 + 1);
  if (a1 == a2) {
    int v = 0;
    while (s[f] == '.') {
      f++;
      v++;
    }
    a2 -= v;
  }
  cout << max(0, a2) << endl;
  return 0;
}
