#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = LLONG_MAX;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int b, w, a, c, d;
  b = w = a = c = d = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      b++;
    else if (s[i] == '.') {
      w++;
      if (b > 0) a++;
    }
    if (s[n - 1 - i] == '#' && c > 0)
      d++;
    else if (s[n - 1 - i] == '.')
      c++;
  }
  cout << (min(min(n - b, n - w), min(a, d))) << endl;
  return 0;
}
