#include <bits/stdc++.h>
void input_vector(int &x);
void show(int x);
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int siro_num = count(S.begin(), S.end(), '.');
  int kuro_num = count(S.begin(), S.end(), '#');
  int ans = min(siro_num, kuro_num);
  cout << ans << endl;
}
void input_vector(int &x) { cin >> x; }
void show(int x) { cout << x << " "; }
