#include <bits/stdc++.h>
using namespace std;
const long long inf = 1000000007;
long long bin(long long bina) {
  long long ans = 0;
  for (long long i = 0; bina > 0; i++) {
    ans = ans + (bina % 2) * pow(10, i);
    bina = bina / 2;
  }
  return ans;
}
bool prime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return n != 1;
}
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x * y / gcd(x, y); }
long long kai(long long x) {
  if (x == 0) return 1;
  return kai(x - 1) * x % inf;
}
long long mod_pow(long long x, long long y, long long mod) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x % mod;
    }
    x = x * x % mod;
    y >>= 1;
  }
  return res;
}
long long comb(long long x, long long y) {
  return kai(x) * mod_pow(kai(x - y), inf - 2, inf) % inf *
         mod_pow(kai(y), inf - 2, inf) % inf;
}
signed main() {
  long long n;
  long long a = 0, b = 0, c = 0;
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 0; i < n; ++i) {
    if (s[i] == '#')
      a++;
    else {
      b++;
      c = i;
    }
  }
  for (long long i = c; i < n; ++i) {
    if (s[i] == '#') a--;
  }
  cout << min(a, b) << endl;
}
