#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1000000007;
const ll INF = 9999999999;
const int INFI = 2147483647;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline T powerM(T a, T b) {
  if (b == 0) return 1;
  T tmp = powerM(a, b / 2);
  if (b % 2 == 0)
    return tmp * tmp % MOD;
  else
    return tmp * tmp % MOD * a % MOD;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool yet = true;
  int black = 0, white = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (yet) {
      if (s.at(i) == '#')
        continue;
      else {
        yet = false;
      }
    }
    if (s.at(i) == '#')
      black++;
    else
      white++;
  }
  cout << min(black, white) << endl;
}
