#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline void in(T &p) {
  cin >> p;
}
template <class T1, class T2>
inline void in(T1 &p1, T2 &p2) {
  cin >> p1 >> p2;
}
template <class T1, class T2, class T3>
inline void in(T1 &p1, T2 &p2, T3 &p3) {
  cin >> p1 >> p2 >> p3;
}
template <class T1, class T2, class T3, class T4>
inline void in(T1 &p1, T2 &p2, T3 &p3, T4 &p4) {
  cin >> p1 >> p2 >> p3 >> p4;
}
template <class T>
inline void ins(T &p) {
  for_each((p).begin(), (p).end(), in<decltype(p[0])>);
}
template <class T>
inline void out(T p) {
  cout << p << endl;
}
template <class T1, class T2>
inline void out(T1 p1, T2 p2) {
  cout << p1 << " " << p2 << endl;
}
template <class T1, class T2, class T3>
inline void out(T1 p1, T2 p2, T3 p3) {
  cout << p1 << " " << p2 << " " << p3 << endl;
}
template <class T1, class T2, class T3, class T4>
inline void out(T1 p1, T2 p2, T3 p3, T4 p4) {
  cout << p1 << " " << p2 << " " << p3 << " " << p4 << endl;
}
template <class T>
inline void outs(T p) {
  for_each((p).begin(), (p).end(), out<decltype(p[0])>);
}
inline void solve(void) {
  long N, ans = 0;
  string S;
  in(N, S);
  for (auto i = (N - 1); i >= (1); --i) {
    if (S[i] == '.' && S[i - 1] == '#') {
      ans++;
      S[i - 1] = '.';
    }
  }
  out(ans);
}
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return EXIT_SUCCESS;
}
