#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> V;
  int count_s = 0;
  int count_d = 0;
  int mini = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      count_s++;
      if (count_d != 0) {
        V.push_back(count_d);
        count_d = 0;
      }
    } else {
      count_d++;
      if (count_s != 0) {
        V.push_back(count_s);
        count_s = 0;
      }
    }
  }
  if (count_d != 0) V.push_back(count_d);
  if (S[0] == '.') V.erase(V.begin());
  if (V.size() == 0)
    cout << 0 << "\n";
  else {
    int sum = 0;
    for (int i = 1; i < V.size(); i = i + 2) {
      sum += V[i];
    }
    mini = sum;
    for (int i = 1; i < V.size(); i = i + 2) {
      sum += (V[i - 1] - V[i]);
      mini = min(sum, mini);
    }
  }
  cout << mini << endl;
}
