#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int N, pe = 0, be = 0, pd, bd, min = 100010;
  char S[200010], aux;
  cin >> N;
  cin.ignore();
  for (int i = 0; i < N; i++) {
    cin >> aux;
    S[i] = aux;
    if (aux == '#')
      pd++;
    else
      bd++;
  }
  if (pe + bd < min) min = pe + bd;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      pd--;
      pe++;
    } else {
      bd--;
      be++;
    }
    if (pe + bd < min) min = pe + bd;
  }
  cout << min << endl;
  return 0;
}
