#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long N;
  cin >> N;
  string S;
  cin >> S;
  long long change_b_w = 0;
  bool flag = false;
  for (long long i = N - 1; 0 <= i; i--) {
    if (S[i] == '.') flag = true;
    if (flag && S[i] == '#') change_b_w += 1;
  }
  long long change_w_b = 0;
  flag = false;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '#') flag = true;
    if (flag && S[i] == '.') change_w_b += 1;
  }
  cout << min(change_b_w, change_w_b) << endl;
  return 0;
}
