#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int w_s = 0;
  int b_s = 0;
  int white = 0;
  int black = 0;
  int tmp = 0;
  int ans = N;
  for (int i = 0; i < (int)(N); i++) {
    if (S[i] == '#')
      b_s++;
    else
      w_s++;
  }
  for (int i = 0; i < (int)(N); i++) {
    if (S[i] == '#')
      black++;
    else
      white++;
    tmp = black + (w_s - white);
    ans = min(tmp, ans);
  }
  cout << ans << endl;
  return 0;
}
