#include <bits/stdc++.h>
using namespace std;
int b[2000005];
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int f = 0, l = n - 1;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  if (n == 2) {
    if (s[0] == '#' && s[1] == '.')
      cout << 1 << endl;
    else
      cout << 0 << endl;
    return 0;
  }
  while (s[f] == '.') f++;
  while (s[l] == '#') l--;
  int k = l - f + 1, sum = 0;
  for (int i = f; i <= l; i++)
    if (s[i] == '#') sum++;
  cout << max(0, min(sum, k - sum)) << endl;
  return 0;
}
