#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18, MOD = 1e9 + 7;
int main() {
  string s;
  int n, start = 0;
  cin >> n >> s;
  while (s[n - 1] == '#' && n > 0) n--;
  while (s[start] == '.' && start < n) start++;
  int ans = 0;
  for (int i = start; i < n; i++)
    if (s[i] == '#') ans++;
  cout << min(ans, (n - start) - ans) << endl;
}
