#include <bits/stdc++.h>
using namespace std;
typedef priority_queue<int, vector<int>, greater<int>> spqint;
typedef priority_queue<long long, vector<long long>, greater<long long>> spqll;
typedef priority_queue<int, vector<int>, less<int>> bpqint;
typedef priority_queue<long long, vector<long long>, less<long long>> bpqll;
int INF = 1e9;
int NIL = -1;
long long MOD = 1000000007;
long long LINF = 1e18;
double EPS = 1e-9;
double PI = M_PI;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
void yes() { cout << "Yes" << endl; }
void no() { cout << "No" << endl; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  std::chrono::system_clock::time_point start, end;
  start = std::chrono::system_clock::now();
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  for (int i = 0; i < (int)(n - 1); i++) {
    if (s[i] == '#' & s[i + 1] == '.') {
      ans++;
      s[i + 1] = '#';
    }
  }
  cout << ans << endl;
  end = std::chrono::system_clock::now();
  auto elapsed =
      std::chrono::duration_cast<std::chrono::milliseconds>(end - start)
          .count();
  return 0;
}
