#include <bits/stdc++.h>
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
template <class T>
void view(T e) {
  cout << e << endl;
}
template <class T>
void view(const vector<T> &v) {
  for (const auto &e : v) {
    cout << e << " ";
  }
  cout << endl;
}
template <class T>
void view(const vector<vector<T>> &vv) {
  for (const auto &v : vv) {
    view(v);
  }
}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int, int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans1 = 0;
  string tmp_s = s;
  for (int i = 0; i < n - 1; i++) {
    if (tmp_s[i] == '#' && tmp_s[i + 1] == '.') {
      ans1++;
      tmp_s[i + 1] = '#';
    }
  }
  int ans2 = 0;
  for (int i = n - 2; i >= 0; i--) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans2++;
      s[i] = '.';
    }
  }
  cout << min(ans1, ans2) << endl;
}
