#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int b_count = 0;
  int w_count = 0;
  int loc;
  for (auto i = 0; i < N; i++)
    if (S[i] == '#') b_count++;
  for (auto i = 0; i < N; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      loc = i + 1;
      break;
    }
  }
  for (auto i = loc; i < N; i++)
    if (S[i] == '.') w_count++;
  w_count <= b_count ? cout << w_count << endl : cout << b_count << endl;
  return 0;
}
