#include <bits/stdc++.h>
using namespace std;
template <class T = long long>
T in() {
  T x;
  cin >> x;
  return (x);
}
template <class T>
void print(T x) {
  cout << x << "\n";
}
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans1 = 0, ans2 = 0;
  long long cnt = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[n - i - 1] != '#') {
      ans2++;
    }
    if (s[n - i - 1] == '.') {
      cnt++;
    } else {
      ans1 += cnt;
      cnt = 0;
    }
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
