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