#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const long long INF = 1LL << 50;
using P = pair<long long, long long>;
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  } else {
    return false;
  }
}
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  } else {
    return false;
  }
}
struct Setup {
  Setup() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} SETUP;
signed main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  bool a_flg = false;
  bool a_r = true;
  long long a = 0, b = 0;
  for (auto c : s) {
    if (c == '#') {
      a++;
      a_flg = true;
    } else {
      b++;
      if (a_flg) {
        a_r = false;
      }
    }
  }
  if (s[n - 1] == '#' && !a_r) {
    a--;
  }
  long long ans = min(a, b);
  cout << ans << endl;
}
