#include <bits/stdc++.h>
using namespace std;
const int lim = 1000000007;
const int INF = 100000000;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  if (N == 1) {
    cout << 0 << endl;
    return 0;
  }
  int white = 0, black = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') white++;
  }
  int ans = INF;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') black++;
    if (S[i] == '.') white--;
    ans = min(ans, black + white);
  }
  cout << ans << endl;
  return 0;
}
