#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> black(N + 1, 0);
  vector<int> white(N + 1, 0);
  int cnt1;
  int cnt2;
  int ans = 999999;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      black[i + 1]++;
    } else {
      white[i + 1]++;
    }
    if (S[i] == '.' && S[i + 1] == '#') {
      cnt1 = black[i + 1] - black[0];
      cnt2 = white[N] - white[i + 1];
    }
    ans = min({ans, cnt1, cnt2});
  }
  cout << ans << endl;
}
