#include <bits/stdc++.h>
using namespace std;
const long long ZERO = 0;
const long long INF = 9223372036854775807;
const long long MOD = 1000000007;
const double PI = 3.1415926535897;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int cnt1 = 0;
  int cnt2 = 0;
  string s = S;
  string t = S;
  for (int i = 0; i < N - 1; i++) {
    if (s.at(i) == '#' && s.at(i + 1) == '.') {
      cnt1++;
      s.at(i + 1) = '#';
    }
  }
  for (int i = N - 1; i > 0; i--) {
    if (t.at(i) == '.' && t.at(i - 1) == '#') {
      cnt2++;
      t.at(i - 1) = '.';
    }
  }
  cout << min(cnt1, cnt2) << endl;
}
