#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  int white_num = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') white_num++;
  }
  vector<int> black(n + 1, 0);
  vector<int> white(n + 1, white_num);
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      black[i + 1] = black[i] + 1;
      white[i + 1] = white[i];
    } else {
      white[i + 1] = white[i] - 1;
      black[i + 1] = black[i];
    }
  }
  int res = INT_MAX;
  for (int i = 1; i < n + 1; i++) {
    res = min(res, black[i] + white[i]);
  }
  cout << res << endl;
}
