#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline bool minimize(T1& a, T2 b) {
  return b < a && (a = b, 1);
}
template <class T1, class T2>
inline bool maximize(T1& a, T2 b) {
  return a < b && (a = b, 1);
}
template <class T, class V>
istream& operator>>(istream& ist, pair<T, V>& p) {
  return ist >> p.first >> p.second;
}
template <class T>
ostream& operator<<(ostream& ost, pair<T, T>& p) {
  return ost << p.first << ", " << p.second;
}
template <class T>
istream& operator>>(istream& ist, vector<T>& vs) {
  for (auto& e : vs) ist >> e;
  return ist;
}
int const inf = INT_MAX / 2;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = std::count_if(S.begin(), S.end(), [](char c) { return c == '#'; });
  int x = 0;
  for (int i = 0; i < (int)N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      x++;
      S[i + 1] = '#';
    }
  }
  ans = min(ans, x);
  cout << ans << endl;
}
