n = int(input())  # 数値入力
str = list(input())  # 一文字ずつ格納
newstr = []
for i in range(len(str)):
    if str[i] == "#":
        newstr = str[i:]
        break

if len(newstr) == 0:
    print("0")
else:
    print(min(newstr.count("."), newstr.count("#")))
