#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e17 + 9;
long long power(long long a, long long b, long long p) {
  long long ans = 1;
  while (b) {
    if (b & 1) {
      ans = (ans * a) % p;
    }
    a = (a * a) % p;
    b >>= 1;
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, cnt1 = 0, cnt2 = 0, flag = 0;
  string str;
  cin >> n >> str;
  for (long long i = 0; i < n; i++) {
    if (!flag && str[i] == '.') continue;
    flag = 1;
    if (str[i] == '.') cnt1++;
  }
  flag = 0;
  for (long long i = n - 1; i >= 0; i--) {
    if (!flag && str[i] == '#') continue;
    flag = 1;
    if (str[i] == '#') cnt2++;
  }
  cout << min(cnt1, cnt2);
  return 0;
}
