#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
long long my_gcd(long long x, long long y) {
  long long r;
  while (y != 0) {
    r = x % y;
    x = y;
    y = r;
  }
  return x;
}
long long my_lcm(long long x, long long y) { return (x * y) / my_gcd(x, y); }
long long my_pow(long long x, long long y) {
  long long sum = 1;
  while (y > 0) {
    sum *= x;
    --y;
  }
  return sum;
}
bool dfs(int x, int y);
long long n;
string s;
int main() {
  cin >> n >> s;
  long long cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#' && s[i + 1] == '.') {
      if (i - 1 == -1) {
        ++cnt;
      } else if (s[i - 1] != '#') {
        ++cnt;
      } else {
        s[i + 1] = '#';
        ++cnt;
      }
    }
  }
  cout << cnt << endl;
  return 0;
}
