import numpy as np

n = int(input())
s = np.array(list(input())) == '.'

index = np.where(s[::-1])[0][0]

if index == 0:
    check_list = s
else:
    check_list = s[:-index]

print(min(check_list.sum(), np.logical_not(check_list).sum()))