# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

n = int(input())
s = input()
s = list(s)

c = 0
for i in range(1,n):
    if s[i - 1] == '#' and s[i] == '.':
        s[i] = '#'
        c += 1
print(c)


