#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  string str[N];
  for (int i = 0; i < N; i++) {
    str[i] = S.substr(i, 1);
  }
  int ans = 0;
  string stra[N];
  for (int m = 0; m < N; m++) {
    stra[m] = str[m];
  }
  for (int j = 0; j < N - 1; j++) {
    if (stra[j] == "#" && stra[j + 1] == ".") {
      stra[j + 1] = "#";
      ans++;
    }
  }
  int ansbetu = 0;
  for (int k = N - 1; k >= 1; k--) {
    if (str[k] == "." && str[k - 1] == "#") {
      str[k - 1] = ".";
      ansbetu++;
    }
  }
  if (ans > ansbetu) {
    cout << ansbetu << endl;
  } else {
    cout << ans << endl;
  }
}
