#include <bits/stdc++.h>
using namespace std;
int n, fb[200010], fw[200010];
string s;
int main() {
  cin >> n;
  cin >> s;
  fb[0] = fw[n] = 0;
  for (int i = 0; i < n; ++i)
    if (s[i] == '#') fb[i + 1] = fb[i] + 1;
  for (int i = n - 1; i >= 0; --i)
    if (s[i] == '.') fw[i] = fw[i + 1] + 1;
  int res = min(fb[n], fw[0]);
  for (int i = 1; i < n; ++i) res = min(res, fb[i] + fw[i]);
  cout << res;
  return 0;
}
