#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int a = 0;
  for (int i = 0; i < (n); ++i)
    if (s[i] == '#') a++;
  int b = 0;
  bool flag = 0;
  for (int i = 0; i < (n); ++i) {
    if (!flag && s[i] == '.') continue;
    flag = 1;
    if (s[i] == '.') b++;
  }
  cout << min(a, b) << endl;
}
