#include <bits/stdc++.h>
using namespace std;
constexpr auto INF = 1000000000;
constexpr auto mod = 1000000007;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
struct UnionFind {
  vector<int> par;
  UnionFind(int N) : par(N) {
    for (int i = 0; i < N; i++) par[i] = i;
  }
  int size(int a) { return par[root(a)]; }
  int root(int x) {
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  void unite(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    if (rx == ry) return;
    par[rx] = ry;
  }
  bool same(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};
int gcd(int a, int b) {
  if (b > a) swap(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  for (int i = (0); i < (n - 1); i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
      s[i + 1] = '#';
    }
  }
  cout << ans << endl;
  return 0;
  return 0;
}
