#include <bits/stdc++.h>
using namespace std;
const long long int logx = 30;
const long long int N = 1e5 + 1;
const long long int M = 2e5 + 5;
const long long int mod = 1e9 + 7;
const long long int INF = 1e18;
const double PI = 3.14159265358979323846;
inline long long int mul(long long int a, long long int b) {
  return (a * 1ll * b) % mod;
}
inline long long int sub(long long int a, long long int b) {
  long long int c = a - b;
  if (c < 0) c += mod;
  return c;
}
inline long long int add(long long int a, long long int b) {
  long long int c = a + b;
  if (c > mod) c -= mod;
  return c;
}
template <typename T>
T power(T x, T y, long long int m) {
  T ans = 1;
  while (y > 0) {
    if (y & 1LL) ans = (ans * x) % m;
    y >>= 1ll;
    x = (x * x) % m;
  }
  return ans % m;
}
int main() {
  long long int n;
  cin >> n;
  string second, k;
  cin >> second;
  k = second;
  long long int cnt = 0, x = 0;
  for (long long int i = 0; i < n - 1; i++) {
    if (second[i] == '.') {
      continue;
    }
    if (second[i + 1] == '.') {
      second[i + 1] = '#';
      cnt++;
    }
  }
  second = k;
  for (long long int i = n - 1; i >= 1; i--) {
    if (second[i] == '#') {
      continue;
    }
    if (second[i - 1] == '#') {
      second[i - 1] = '.';
      x++;
    }
  }
  cout << min(x, cnt) << endl;
}
