#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = N;
  int cnt = 0;
  bool black = false;
  for (int i = 0; i < (S.size()); i++) {
    if (S[i] == '#') black = true;
    if (black && S[i] == '.') cnt++;
  }
  ans = min(ans, cnt);
  bool white = false;
  for (int i = S.size() - 1; i >= 0; i--) {
    if (S[i] == '.') white = true;
    if (white && S[i] == '#') cnt++;
  }
  ans = min(ans, cnt);
  cout << ans << endl;
}
