#include <bits/stdc++.h>
const long long INF = 1LL << 60;
using namespace std;
using ll = long long;
using ld = long double;
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 main(void) {
  ll N, i, a = 0, b = 0;
  string S;
  cin >> N >> S;
  i = 0;
  while (S[i] == '.') {
    i++;
  }
  while (i < N) {
    if (S[i] == '.') {
      a++;
    }
    i++;
  }
  i = N - 1;
  while (S[i] == '#') {
    i--;
  }
  while (i >= 0) {
    if (S[i] == '#') {
      b++;
    }
    i--;
  }
  cout << min(a, b) << endl;
  return 0;
}
