#include <bits/stdc++.h>
using namespace std;
int const N = 1e6 + 10, oo = 1e9;
long long const OO = 2e18;
double const eps = 1e-8, PI = acos(-1);
int mod = oo + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int i = 0;
  while (i < n && s[i] == '.') i++;
  if (i == n) {
    cout << 0;
    return 0;
  }
  int j = n - 1;
  while (j > -1 && s[j] == '#') j--;
  if (j == -1) {
    cout << 0;
    return 0;
  }
  int cc = 0;
  for (int k = i; k <= j; k++) cc += s[k] == '.';
  cout << min(cc, j - i + 1 - cc);
  return 0;
}
