#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
long long gcd(long long x, long long y) {
  if (x < y) {
    long long temp = x;
    x = y;
    y = temp;
  }
  long long r = x % y;
  while (r != 0) {
    x = y;
    y = r;
    r = x % y;
  }
  return y;
}
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int n;
  int cnt_1 = 0;
  bool tmp_1 = false;
  bool tmp_2 = false;
  int cnt_2 = 0;
  string S_2 = S;
  while (1) {
    int tmp_cnt_1 = cnt_1;
    for (int i = 0; i < N - 1; i++) {
      if (S[i] == '#' && S[i + 1] == '.') {
        cnt_1++;
        S[i + 1] = '#';
        break;
      }
    }
    if (tmp_cnt_1 == cnt_1) break;
  }
  while (1) {
    int tmp_cnt_2 = cnt_2;
    for (int i = 0; i < N - 1; i++) {
      if (S_2[i] == '#' && S_2[i + 1] == '.') {
        cnt_2++;
        S_2[i] = '.';
        break;
      }
    }
    if (tmp_cnt_2 == cnt_2) break;
  }
  cout << min(cnt_1, cnt_2) << endl;
}
