#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
template <typename P, typename Q>
ostream& operator<<(ostream& os, pair<P, Q> p) {
  os << "(" << p.first << ": " << p.second << ")";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << "(";
  for (auto& i : v) os << i << ", ";
  os << ")";
  return os;
}
template <typename K, typename V>
ostream& operator<<(ostream& os, map<K, V> m) {
  os << "{";
  for (auto& i : m) os << i << ", ";
  os << "}";
  return os;
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0;
  for (long long i = 1; i < n; ++i) {
    if (s[i] == '.' && s[i - 1] == '#') ++ans;
  }
  cout << ans << endl;
  return 0;
}
