#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a = 0, b = 0, flag_a = false, flag_b = false;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') flag_a = true;
    if (flag_a && S[i] == '.') a++;
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') flag_b = true;
    if (flag_b && S[i] == '#') b++;
  }
  cout << min(a, b) << endl;
  return 0;
}
