#include <bits/stdc++.h>
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
using namespace std;
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);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a / g * b;
}
bool prime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return n != 1;
}
bool compare_by_b(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}
const long long MOD = 1000000007;
const long long INF = 1LL << 50;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  string tmp = s;
  long long ans = 0;
  for (long long i = 0; i < (s.size()); i++) {
    if (i == 0) continue;
    if (s.at(i) == '.') {
      if (s.at(i - 1) == '#') {
        ans++;
        s.at(i) = '#';
      }
    }
  }
  long long ans2 = 0;
  for (long long i = 0; i < (tmp.size()); i++) {
    if (i == 0) continue;
    if (tmp.at(i) == '.') {
      if (tmp.at(i - 1) == '#') {
        ans2++;
        tmp.at(i - 1) = '.';
      }
    }
  }
  cout << min(ans, ans2) << endl;
  return 0;
}
