#include <bits/stdc++.h>
using namespace std;
template <class T = long long>
T in() {
  T x;
  cin >> x;
  return (x);
}
template <class T>
void print(T x) {
  cout << x << "\n";
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0;
  char now;
  for (int i = 0; i < (n); ++i) {
    if (now == '#' && s[i] == '.') {
      ans++;
    }
    now = s[i];
  }
  cout << ans << endl;
  return 0;
}
