#include <bits/stdc++.h>
using namespace std;
template <class T>
T ceil(T a, T b) {
  return (a + b - 1) / b;
}
template <class T>
T round(T a, T b) {
  return (a + b / 2) / b;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
bool amax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool amin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  int fst = -1, lst = -1;
  for (int i = (int)(1); i < (int)(N); i += (int)(1)) {
    if (S[i - 1] == '#' && S[i] == '.') {
      if (fst < 0) {
        fst = i;
      }
      lst = i;
    }
  }
  if (lst < 0) {
    cout << 0 << endl;
    return 0;
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = (int)(0); i < (int)(lst); i += (int)(1)) {
    if (S[i] == '#') {
      cnt1++;
    }
  }
  for (int i = (int)(fst); i < (int)(N); i += (int)(1)) {
    if (S[i] == '.') {
      cnt2++;
    }
  }
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
