#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007, mod9 = 1000000009;
template <class T>
inline T lcm(T a, T b) {
  return (a * b / __gcd(a, b));
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, i1 = 0, i2 = 0;
  string s, t;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      i1++;
    } else {
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#') {
      i2++;
    } else {
      break;
    }
  }
  int a = 0, b = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      a++;
    } else {
      b++;
    }
  }
  cout << (min(a - i2, b - i1)) << endl;
  return 0;
}
