#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
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; }
bool isPrime(long long x) {
  long long i;
  if (x < 2)
    return 0;
  else if (x == 2)
    return 1;
  if (x % 2 == 0) return 0;
  for (i = 3; i * i <= x; i += 2)
    if (x % i == 0) return 0;
  return 1;
}
int digsum(long long n) {
  int res = 0;
  while (n > 0) {
    res += n % 10;
    n /= 10;
  }
  return res;
}
int dignum(long long n) {
  int res = 0;
  while (n > 0) {
    res++;
    n /= 10;
  }
  return res;
}
long long stringcount(string s, char c) {
  return count(s.cbegin(), s.cend(), c);
}
long long ka(long long i) {
  long long res = 1;
  while (i > 0) {
    res = res * i;
    i--;
  }
  return res;
}
long long ncr(long long x, long long y) {
  long long a = x;
  long long b = 1;
  if (y > (x / 2)) {
    y = x - y;
  }
  for (long long i = 1; i < y; i++) {
    a *= x - i;
    b *= i + 1;
  }
  return a / b;
}
long long f(long long x) {
  long long dp[x + 1];
  dp[1] = 1;
  dp[2] = 1;
  for (long long i = 3; i <= x; i++) {
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  return dp[x];
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  for (long long(i) = 0; (i) < (n - 1); (i)++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
