#include <bits/stdc++.h>
using namespace std;
using vvll = vector<vector<long long>>;
long long mod = 1e9 + 7;
template <typename TypeInt>
string itob(const TypeInt v, int base) {
  static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  string ret;
  static numeric_limits<TypeInt> t;
  TypeInt n = v;
  if (t.is_signed) {
    if (v < 0) n *= -1;
  }
  while (n >= base) {
    ret += table[n % base];
    n /= base;
  }
  ret += table[n];
  if (t.is_signed) {
    if (v < 0 && base == 10) ret += '-';
  }
  reverse(ret.begin(), ret.end());
  return ret;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int ctoi(char c) { return c - '0'; }
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a / g * b;
}
bool primecheck(long long n) {
  if (n < 2)
    return false;
  else {
    for (int i = 2; i * i <= n; i++) {
      if (n % i == 0) return false;
    }
    return true;
  }
}
string reverserange(string s, long long a, long long b) {
  reverse(s.begin() + a - 1, s.begin() + b);
  return s;
}
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n % 2 == 1) {
      res = res * a % mod;
    }
    a = a * a % mod;
    n /= 2;
  }
  return res;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int kuro = 0, siro = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s.at(i) == '#') siro++;
  }
  int kuronum = -1;
  for (int i = 0; i < n; i++) {
    if (kuronum == -1 && s.at(i) == '#') kuronum = i;
  }
  if (kuronum == -1) {
    cout << siro << endl;
    return 0;
  }
  for (int i = n - 1; i >= kuronum; i--) {
    if (s.at(i) == '.') kuro++;
  }
  int ans = min(kuro, siro);
  cout << ans << endl;
}
