#include <bits/stdc++.h>
using namespace std;
const long long INF = 1001001001001001001ll;
const long long LINF = 1001001001001001001ll;
const long long MOD = 1000000007;
const double EPS = 1e-9;
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  long long len = v.size();
  for (long long i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1) s << ' ';
  }
  return s;
}
template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  long long len = vv.size();
  for (long long i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1) s << '\n';
  }
  return s;
}
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;
}
__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
signed main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  long long FirstBlack = -1;
  for (long long i = 0; i < (N); ++i) {
    if (S[i] == '#') {
      FirstBlack = i;
      break;
    }
  }
  if (FirstBlack == -1) {
    cout << 0 << endl;
    return 0;
  }
  long long ans = 0;
  for (long long i = N - 1; i >= (FirstBlack); --i) {
    if (S[i] == '.') ans++;
  }
  cout << ans << endl;
}
