#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b = 0, w = 0, ans = 0;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') b++;
    if (s[i] == '.') w++;
  }
  if (b == n || w == n) {
    cout << "0";
    return 0;
  }
  if (b == w) {
    int flag = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '.') {
        if (flag == 1) ans++;
      } else
        flag = 1;
    }
    cout << ans;
    return 0;
  }
  if (b < w) {
    int flag = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (s[i] == '#') {
        if (flag == 1) ans++;
      } else
        flag = 1;
    }
    cout << ans;
    return 0;
  }
  if (b > w) {
    int flag = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '.') {
        if (flag == 1) ans++;
      } else
        flag = 1;
    }
    cout << ans;
    return 0;
  }
}
