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