#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  string S;
  cin >> N >> S;
  int blacknumber = 0, whitenumber = 0;
  for (int(i) = 0; (i) < (N); (i)++) {
    if (S[i] == '#') {
      blacknumber++;
    } else {
      whitenumber++;
    }
  }
  int ans = 0;
  int answer = whitenumber;
  ans = answer;
  for (int(i) = 0; (i) < (N); (i)++) {
    if (S[i] == '#') {
      answer++;
    } else {
      answer = answer--;
    }
    if (ans > answer) {
      ans = answer;
    }
  }
  cout << ans;
  return 0;
}
