#include <bits/stdc++.h>
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
using namespace std;
int main(void) {
  char s[200001];
  int ans = 0, ans2 = 0, n;
  bool isb = false, isw = false;
  cin >> n;
  cin >> s;
  for (int i = 0, i_len = (n); i < i_len; ++i) {
    if (s[i] == '.')
      isw = true;
    else
      isb = true;
    if (s[i] == '.' && isw && isb) ans++;
    if (isw && s[i] == '#') ans2++;
  }
  cout << min(ans, ans2) << endl;
  return 0;
}
