#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  int kuro = 0, siro = 0;
  int l = 0, r = n;
  for (int i = 0; i < n && s[i] == '.'; i++) l++;
  for (int i = n - 1; i > l; i--) {
    if (s[i] == '.')
      siro++;
    else
      kuro++;
  }
  ans = siro > kuro ? kuro : siro;
  cout << ans << endl;
  return 0;
}
