#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 1001001001;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = INF;
  for (long long(ri) = 0; (ri) < (2); (ri)++) {
    vector<int> black(n + 1);
    vector<int> white(n + 1);
    for (long long(i) = 0; (i) < (n); (i)++)
      black[i + 1] = black[i] + (s[i] == '.');
    for (long long(i) = 0; (i) < (n); (i)++)
      white[i + 1] = white[i] + (s[i] == '#');
    int t = INF;
    for (long long(i) = 0; (i) < (n + 1); (i)++)
      t = min(black[i] + white[n - i], t);
    ans = min(t, ans);
  }
  cout << ans << endl;
}
