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