import numpy as np

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

if s.sum() == 0 or s.sum() == n:
    print(0)
    exit()

if not s[0]:
    first_index = np.where(s)[0][0]
else:
    first_index = np.where(np.logical_not(s))[0][0]

if first_index < n:
    second_index = np.where(s[first_index:] == s[0])[0][0] + first_index

    if second_index < n:
        check_list = s[second_index:]

        print(min(check_list.sum(), np.logical_not(check_list).sum()) + min(s[:second_index].sum(),
                                                                            np.logical_not(s[:second_index]).sum()))
    else:
        print(min(s.sum(), np.logical_not(s).sum()))
else:
    print(min(s.sum(), np.logical_not(s).sum()))