#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}
signed main() {
  long long N;
  string S;
  cin >> N;
  cin >> S;
  long long x = 0;
  long long y = 0;
  long long z = 0;
  long long flag = 0;
  long long kuro[N];
  for (long long i = 0; i < (N); i++) {
    if (S[i] == '#') {
      x++;
    } else {
      y++;
    }
  }
  long long s = 0;
  long long g = N - 1;
  while (s <= g) {
    while (S[s] == '.') {
      s++;
      if (s == g) {
        break;
      }
    }
    if (s == g) {
      break;
    }
    z++;
    while (S[g] == '#') {
      g--;
      if (g == s) {
        break;
      }
    }
    if (s == g) {
      break;
    }
    z++;
  }
  if (x == 0 || y == 0) {
    cout << "0" << endl;
    return 0;
  }
  long long ans = min({x, y, z});
  cout << ans << endl;
  return 0;
}
