#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  char S[200010];
  char S_copy[200010];
  cin >> N;
  cin >> S;
  char black = '#';
  char white = '.';
  int black_cnt = 0;
  int white_cnt = 0;
  if (S[0] == black) black_cnt++;
  for (int i = 1; i < N; i++) {
    if (S[i] == white) white_cnt++;
  }
  int res = black_cnt + white_cnt;
  for (int i = 1; i < N; i++) {
    if (S[i] == black) {
      black_cnt++;
    } else {
      white_cnt--;
    }
    res = min(res, black_cnt + white_cnt);
  }
  cout << res << "\n";
}
