#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
using Edge = pair<int, long long>;
using Graph = vector<vector<Edge> >;
const long long mod = 1e9 + 7;
long long dx[4] = {1, 0, -1, 0};
long long dy[4] = {0, 1, 0, -1};
void printvll(vector<long long> v) {
  cout << "------------------------------------------------\n";
  for (int i = 0; i < v.size(); ++i) cout << v[i] << " ";
  cout << endl;
  cout << "------------------------------------------------\n";
}
void printvvll(vector<vector<long long> > v) {
  cout << "------------------------------------------------\n";
  for (int i = 0; i < v.size(); ++i) {
    for (int j = 0; j < v[i].size(); ++j) {
      cout << v[i][j] << " ";
    }
    cout << endl;
  }
  cout << "------------------------------------------------\n";
}
void prints(string s) {
  cout << "------------------------------------------------\n";
  for (int i = 0; i < s.size(); ++i) cout << s[i] << " ";
  cout << endl;
  cout << "------------------------------------------------\n";
}
void printvs(vector<string> s) {
  cout << "------------------------------------------------\n";
  for (int i = 0; i < s.size(); ++i) {
    for (int j = 0; j < s[i].size(); ++j) {
      cout << s[i][j] << " ";
    }
    cout << endl;
  }
  cout << "------------------------------------------------\n";
}
void Yes(bool x) {
  if (x)
    cout << "Yes\n";
  else
    cout << "No\n";
}
void YES(bool x) {
  if (x)
    cout << "YES\n";
  else
    cout << "NO\n";
}
void yes(bool x) {
  if (x)
    cout << "yes\n";
  else
    cout << "no\n";
}
void Yay(bool x) {
  if (x)
    cout << "Yay!\n";
  else
    cout << ":(\n";
}
long long gcd(long long x, long long y) {
  long long r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
long long lcm(long long x, long long y) {
  x /= gcd(x, y);
  y /= gcd(x, y);
  return (x * y);
}
long long d, n, r, l, k, ans = 0, ret = 1000000000000000000LL;
bool flag = false, flag2 = false, flag3 = false;
string s, t;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> s;
  for (int i = (1); i < (n); ++i) {
    if (s[i] == '.' && s[i - 1] == '#') ans++;
  }
  cout << ans << endl;
}
