#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int flag = 0, count = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') flag = 1;
    if (flag == 1 && S.at(i) == '.') count++;
  }
  int sub = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') sub++;
  }
  if (sub == 1 && S.at(N - 1) == '#')
    cout << 0 << endl;
  else
    cout << min(count, sub) << endl;
  return 0;
}
