#include <bits/stdc++.h>
using namespace std;
long long n, ans;
string s;
signed main() {
  cin >> n >> s;
  long long karians = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] != '.') karians++;
  }
  long long karians2 = 0;
  for (long long i = 1; i < n; i++) {
    if (s[i] != '#') karians2++;
  }
  cout << min(karians, karians2) << endl;
}
