#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  string s;
  cin >> n >> s;
  vector<int> bl(n + 1, 0), wh(n + 1, 0);
  for (int i = 0; i < n; i++) {
    bl[i + 1] = bl[i] + (s[i] == '#' ? 1 : 0);
    wh[i + 1] = wh[i] + (s[i] == '.' ? 1 : 0);
  }
  int ans = 1e9;
  for (int i = 1; i < n + 1; i++) {
    ans = min(ans, (bl[i] - bl[0]) + (wh[n] - wh[i]));
  }
  cout << ans << '\n';
  return 0;
}
