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