#include <bits/stdc++.h>
using namespace std;
int N;
string S;
int black_stone = 0;
int white_stone = 0;
int minSt;
int main() {
  cin >> N >> S;
  minSt = N + 5;
  vector<vector<int>> ishi(N + 2, vector<int>(2));
  for (int i = 0; i < N; i++) {
    if (S[i] == '.')
      white_stone++;
    else if (S[i] == '#')
      black_stone++;
  }
  ishi[1][0] = 0;
  ishi[1][1] = white_stone;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      ishi[i + 2][0] = ishi[i + 1][0] + 0;
      ishi[i + 2][1] = ishi[i + 1][1] - 1;
    } else if (S[i] == '#') {
      ishi[i + 2][0] = ishi[i + 1][0] + 1;
      ishi[i + 2][1] = ishi[i + 1][1] - 0;
    }
  }
  for (int i = 1; i <= N; i++) minSt = min(minSt, ishi[i][0] + ishi[i][1]);
  cout << minSt << endl;
  return 0;
}
