#include <bits/stdc++.h>
using namespace std;
inline void FAST_IO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  FAST_IO();
  int n;
  string s;
  cin >> n >> s;
  int blacks = 0;
  int whites = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '.') whites++;
    if (s[i] == '#' && whites) blacks++;
  }
  cout << min(blacks, whites) << endl;
  return 0;
}
