#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
const int MOD = 1e9 + 7;
template <class T>
inline bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  cin.tie(0), ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool flag = false;
  int ans = 0;
  for (int i = 0; i < int(n); i++) {
    if (s[i] == '#') flag = true;
    if (flag) ans += (s[i] == '.');
  }
  cout << ans;
  cout << endl;
  return 0;
}
