#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using vc = vector<char>;
using pll = pair<ll, ll>;
template <class T>
void print1d(T x, ll n = -1) {
  if (n == -1) n = x.size();
  for (long long i = 0; i < n; ++i) {
    cout << x[i] << ' ';
  }
  cout << '\n';
}
template <class T>
void print2d(T x, ll r = -1, ll c = -1) {
  if (r == -1) r = x.size();
  if (c == -1) c = x[0].size();
  for (long long i = 0; i < r; ++i) print1d(x[i], c);
}
template <class T, class U>
bool haskey(T mp, U key) {
  return mp.find(key) != mp.end();
}
template <class T, class U>
bool isin(T el, U container) {
  return find((container).begin(), (container).end(), el) != container.end();
}
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool even(T n) {
  return !(n & 1);
}
template <class T>
bool odd(T n) {
  return n & 1;
}
template <class T>
ld deg2rad(T deg) {
  return M_PI * deg / 180.0;
}
template <class T>
ld rad2deg(T rad) {
  return 180.0 * rad / M_PI;
}
ll intpow(ll a, ll n) {
  ll p = 1;
  while (n) {
    if (n & 1) p *= a;
    a *= a;
    n >>= 1;
  }
  return p;
}
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;
int main() {
  ll N;
  string S;
  cin >> N >> S;
  string SS(S);
  ll ans = 0;
  for (long long i = 0; i < N - 1; ++i) {
    if (S[i] == '#' and S[i + 1] == '.') {
      ++ans;
      S[i + 1] = '#';
    }
  }
  ll ans2 = 0;
  for (long long i = 0; i < N - 1; ++i) {
    if (SS[i] == '#' and SS[i + 1] == '.') {
      ++ans;
      SS[i] = '.';
      ++ans2;
    }
  }
  cout << min(ans, ans2) << endl;
}
