#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 + 2], num_dot[N + 2];
  memset(num_sharp, 0, sizeof(num_sharp));
  memset(num_dot, 0, sizeof(num_dot));
  num_sharp[0] = num_dot[N + 1] = 0;
  for (int i = (int)1; i < (int)N + 1; i++) {
    if (S[i - 1] == '#')
      num_sharp[i] = 1;
    else
      num_sharp[i] = 0;
  }
  for (int i = N; i > 0; i--) {
    if (S[i - 1] == '.')
      num_dot[i] = 1;
    else
      num_dot[i] = 0;
  }
  for (int i = (int)1; i < (int)N + 2; i++) num_sharp[i] += num_sharp[i - 1];
  for (int i = N + 1; i > 0; i--) num_dot[i - 1] += num_dot[i];
  int tmp = 0, rsl = 1e9;
  for (int i = (int)0; i < (int)N + 2; i++) {
    tmp = num_sharp[i] + num_dot[i];
    chmin(rsl, tmp);
  }
  cout << rsl << endl;
}
