#include <bits/stdc++.h>
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vll = std::vector<long long int>;
using vvll = std::vector<std::vector<long long int>>;
using P = std::pair<int, int>;
using vp = std::vector<P>;
using namespace std;
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int w = 0, b = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      w++;
    else
      b++;
  }
  if (s[n - 1] == '#') b--;
  if (s[0] == '.') {
    int i = 0;
    while (s[i] == '.') {
      w--;
      i++;
    }
  }
  int ans = min(w, b);
  cout << ans << endl;
}
