#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s[n];
  int cnt_a = 0, cnt_b = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == '#') cnt_a++;
    if (s[i] == '.') cnt_b++;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#')
      cnt_a--;
    else
      break;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      cnt_b--;
    else
      break;
  }
  int ans = min(cnt_a, cnt_b);
  cout << ans << endl;
}
