#include <bits/stdc++.h>
using namespace std;
const long long N = 300005;
int n;
string s;
int ce(int a, int b) { return (a + b - 1) / b; }
int main() {
  cin >> n >> s;
  int f = 0, ans1 = 0, ans2 = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') f = 1;
    if (f && s[i] == '.') ans1++;
  }
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') f = 1;
    if (f && s[i] == '#') ans2++;
  }
  printf("%d\n", min(ans1, ans2));
  return 0;
}
