#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
const long double EPS = 1e-9L;
inline int sgn(const long double &r) { return (r > EPS) - (r < -EPS); }
inline long double sq(long double x) { return sqrt(max(x, 0.0L)); }
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int firstBlackPos = S.find('#');
  int lastBlaskPos = S.rfind('#');
  string b, w;
  if (firstBlackPos == string::npos) {
    cout << 0 << endl;
  } else {
    for (int i = 0; i < N; ++i) {
      if (i <= firstBlackPos)
        b.push_back(S[i]);
      else
        b.push_back('#');
      if (i < lastBlaskPos)
        w.push_back('.');
      else
        w.push_back('#');
    }
    int bcnt = 0, wcnt = 0;
    for (int i = 0; i < N; ++i) {
      if (S[i] != b[i]) bcnt++;
      if (S[i] != w[i]) wcnt++;
    }
    cout << min(bcnt, wcnt) << endl;
  }
  return 0;
}
