#include <bits/stdc++.h>
using namespace std;
const long long INF = 1ll << 60;
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() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  string S;
  cin >> N >> S;
  int num_sharp[N], num_dot[N];
  int ruiseki_sharp[N + 2], ruiseki_dot[N + 2];
  for (int i = (int)0; i < (int)N; i++) {
    if (S[i] == '#')
      num_sharp[i] = 1;
    else
      num_sharp[i] = 0;
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.')
      num_dot[i] = 1;
    else
      num_dot[i] = 0;
  }
  ruiseki_sharp[0] = 0;
  for (int i = (int)0; i < (int)N; i++)
    ruiseki_sharp[i + 1] = ruiseki_sharp[i] + num_sharp[i];
  ruiseki_sharp[N + 1] = ruiseki_sharp[N];
  ruiseki_dot[N + 1] = 0;
  for (int i = N; i > 0; i--)
    ruiseki_dot[i] = ruiseki_dot[i + 1] + num_dot[i - 1];
  ruiseki_dot[0] = ruiseki_dot[1];
  int tmp = 0, rsl = 1e9;
  for (int i = (int)0; i < (int)N + 2; i++) {
    tmp = ruiseki_dot[i] + ruiseki_sharp[i];
    chmin(rsl, tmp);
  }
  cout << rsl << endl;
}
