#include <bits/stdc++.h>
using namespace std;
int mx8[] = {0, 0, 1, -1, -1, 1, -1, 1};
int my8[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int mx4[] = {1, -1, 0, 0};
int my4[] = {0, 0, -1, 1};
const int MOD = 1000000007;
long long int y[10000005];
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans1 = 0, ans2 = 0, ans3 = 0;
  int i = 0, j = n - 1;
  while (s[i] == '#' && i < n) {
    ans3++;
    i++;
  }
  while (s[i] == '.' && i < n) {
    i++;
  }
  while (s[j] == '.' && j >= 0) {
    ans3++;
    j--;
  }
  while (s[j] == '#' && j >= 0) {
    j--;
  }
  if (i == n && j == -1) {
    for (int k = 0; k < (n); k++) {
      if (s[k] == '.')
        ans1++;
      else
        ans2++;
    }
    cout << min(ans2, ans1) << endl;
    return 0;
  }
  if (i == n || j == -1) {
    cout << 0 << endl;
    return 0;
  }
  for (int k = i; k <= j; k++) {
    if (s[k] == '.')
      ans1++;
    else
      ans2++;
  }
  cout << min(ans1, ans2) + ans3 << endl;
}
