#include <bits/stdc++.h>
using namespace std;
const int lim = 1000000007;
const int INF = 1000000000;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  if (N == 1) {
    cout << 0 << endl;
    return 0;
  }
  vector<int> left(N - 1);
  vector<int> right(N - 1);
  int black = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#') black++;
    left[i] = black;
  }
  reverse(S.begin(), S.end());
  int white = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '.') white++;
    right[i] = white;
  }
  if (black == 0 || white == 0) {
    cout << 0 << endl;
    return 0;
  }
  int ans = INF;
  for (int i = 0; i < N - 1; i++) {
    ans = min(ans, left[i] + right[i]);
  }
  cout << ans << endl;
  return 0;
  return 0;
}
