#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string str;
  cin >> str;
  int ans1 = 0;
  int ans2 = 0;
  bool flag = false;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == '#' && flag == false) flag = true;
    if (flag == true && str[i] == '.') ans1++;
  }
  flag = false;
  for (int i = str.length() - 1; i >= 0; i--) {
    if (str[i] == '.' && flag == false) flag = true;
    if (flag == true && str[i] == '#') ans2++;
  }
  if (ans1 > ans2)
    cout << ans2 << endl;
  else
    cout << ans1 << endl;
  return 0;
}
