input1 = input()
input2 = input()
l_input2 = list(input2)
count = 0
tmp_count = 0
r_l_input2 = l_input2[::-1]
for i in range(0, len(r_l_input2)):
    if r_l_input2[0] == "#":
        del r_l_input2[0]
input2=("").join(r_l_input2[::-1])

if input2.count("#") >= input2.count("."):
    print(input2.count("#."))
else:
    print(input2.count("#"))