#include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
int LCM(int a, int b) { return (a * b) / GCD(a, b); }
int abs(int x) { return x > 0 ? x : -x; }
int main() {
  int n;
  long long ans1 = 0;
  long long ans2 = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      ans1++;
    else
      ans2++;
  }
  if (s[n - 1] == '#') ans2--;
  cout << min(ans1, ans2) << endl;
}
