#include <bits/stdc++.h>
using namespace std;
int N;
string s;
int w[200005], b[200005];
int main() {
  cin >> N;
  cin >> s;
  int white = 0;
  for (int i = 0; i < N; i++) {
    if (s[i] == '.') white++;
  }
  int cnt = min(white, N - white);
  for (int i = 0; i < N; i++) {
    if (i == 0)
      b[0] = s[0] == '#' ? 1 : 0;
    else
      b[i] = s[i] == '#' ? b[i - 1] + 1 : b[i - 1];
  }
  for (int i = N - 1; i >= 0; i--) {
    if (i == N - 1)
      w[i] = s[i] == '#' ? 1 : 0;
    else
      w[i] = s[i] == '#' ? w[i + 1] + 1 : w[i + 1];
  }
  for (int i = 0; i < N; i++) {
    if (i == 0) continue;
    cnt = min(cnt, w[i - 1] + b[i]);
  }
  cout << cnt << endl;
  return 0;
}
