#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char s[200005];
  scanf("%d", &n);
  scanf("%s", s);
  int ans1 = 0, ans2 = 0, ans3 = 0;
  int flag = 0;
  for (int i = 0; s[i] != '\0'; ++i) {
    if (flag && s[i] != '#') ans3++;
    if (s[i] != '.') {
      ans2++;
      flag = 1;
    }
    if (s[i] != '#') ans1++;
  }
  printf("%d\n", min(ans1, min(ans2, ans3)));
  return 0;
}
