#include <bits/stdc++.h>
using namespace std;
inline int toint(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class t>
inline string tostring(t x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
using ll = long long;
using ull = unsigned long long;
const ll mod = 1000000007ll;
template <class ll>
inline ll getCeilExponent(ll a) {
  if (a <= 0) {
    throw invalid_argument("vaule equal to or less than 0 should not be valid");
  }
  ll index = 0;
  --a;
  for (; a != 0; a >>= 1) {
    ++index;
  }
  return index;
}
template <class ll>
inline ll getFloorExponent(ll a) {
  if (a <= 0) {
    throw invalid_argument("vaule equal to or less than 0 should not be valid");
  }
  ll index = 0;
  a >>= 1;
  for (; a != 0; a >>= 1) {
    ++index;
  }
  return index;
}
template <class ll>
inline ll getGcd(ll a, ll b) {
  if (b == 0) {
    return a;
  }
  return getGcd(b, a % b);
}
template <class ll>
inline pair<ll, ll> getBezoutsIdentitySolution(ll a, ll b) {
  if (b == 0) {
    return {1, 0};
  }
  auto sol = getBezoutsIdentitySolution(b, a % b);
  return {sol.second, sol.first - (a / b) * sol.second};
}
inline ll getModValue(ll a, ll m) { return (a % m + m) % m; }
inline ll getModInverse(ll a, ll m) {
  auto sol = getBezoutsIdentitySolution(a, m);
  if (a * sol.first + m * sol.second != 1) {
    return -1;
  }
  return getModValue(sol.first, m);
}
ll getModCombinatorialNumber(ll n, ll r, ll m) {
  ll res = 1;
  for (; n > 0; --n, --r) {
    res = (((res * n) % m) * getModInverse(n, m)) % m;
  }
  return getModValue(res, m);
}
ll getModPower(ll base, unsigned t, ll m) {
  if (t == 0) {
    return 1ll;
  }
  auto res = getModPower(base, t >> 1, m);
  res = getModValue(res * res, m);
  if (t % 2 == 1) {
    res = getModValue(res * base, m);
  }
  return res;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  string S;
  cin >> N >> S;
  bool haveSeenBlack = false;
  ll res = 0;
  for (ll i = 0; i < N; ++i) {
    if (S[i] == '#') {
      haveSeenBlack = true;
    } else if (haveSeenBlack) {
      ++res;
    }
  }
  cout << res << endl;
  return 0;
}
