#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N;
  string S;
  cin >> N >> S;
  int black = -1;
  int white = -1;
  for (int i = 0; i < N; ++i) {
    if (black == -1 && i != 0 && S[i] == '.' && S[i - 1] == '#') black = i - 1;
    if (i != 0 && S[i] == '.' && S[i - 1] == '#') white = i;
  }
  if (white == -1) {
    cout << 0 << endl;
    return 0;
  }
  ll ret1 = 0, ret2 = 0;
  for (int j = 0; j < N; ++j) {
    if (j < white && S[j] == '#') ret1++;
    if (j > black && S[j] == '.') ret2++;
  }
  cout << min(ret1, ret2) << endl;
}
