#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  string s;
  long long ans = 100000000000000000;
  cin >> N;
  cin >> s;
  string a, b;
  string S = "!" + s;
  long long black[N + 1];
  for (int i = 0; i <= N; i++) {
    a = S.substr(i, 1);
    if (a == "#") {
      if (i == 0) {
        black[i] = 1;
      } else {
        black[i] = black[i - 1] + 1;
      }
    } else {
      if (i == 0) {
        black[i] = 0;
      } else {
        black[i] = black[i - 1];
      }
    }
  }
  long long white[N];
  for (int j = N; j >= 0; j--) {
    b = S.substr(j, 1);
    if (b == ".") {
      if (j == N - 1) {
        white[j] = 1;
      } else {
        white[j] = white[j + 1] + 1;
      }
    } else {
      if (j == N - 1) {
        white[j] = 0;
      } else {
        white[j] = white[j + 1];
      }
    }
  }
  for (int i = 0; i < N; i++) {
    ans = min(ans, black[i] + white[i]);
  }
  cout << ans << endl;
}
