#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
char s[maxn];
int main() {
  int n;
  cin >> n;
  int r_i = 0, ret1 = 0;
  int ret2 = 0;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    if (s[i] == '.') r_i = i;
  }
  int flag = 0;
  for (int i = 0; i <= r_i; i++) {
    if (!flag && s[i] == '#') {
      flag = 1;
    }
    if (flag && s[i] == '.')
      ++ret1;
    else if (flag)
      ++ret2;
  }
  if (ret1 <= ret2)
    cout << ret1 << endl;
  else
    cout << ret2 << endl;
}
