#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p_ll = pair<ll, ll>;
int main() {
  int N, white = 0, black = 0, black2 = 0;
  cin >> N;
  vector<char> S(N);
  for (ll i = 0; i < N; ++i) {
    cin >> S[i];
    if (i != N - 1 && S[i] == '#') black++;
    if (S[i] == '.') white++;
    if (i != 0 && S[i] == '.') black2++;
  }
  cout << min(min(black, white), black2) << endl;
  cin >> N;
}
