#改行入力
N = int(input())
S = input()

count = 0

S1 = S
S2 = S

s1_c = 0
s2_c = 0

while 1:
    if "#." in S1:
        S1 = S1.replace("#.", "##",1)
        s1_c = s1_c +1
    else:
        break

while 1:
    if "#." in S2:
        S2 = S2.replace("#.", "..",1)
        s2_c = s2_c +1
    else:
        break




result = min(s1_c, s2_c)


print(result)
