def main():
    N = int(input())
    S = input()
    if len(set(S)) == 1:
        return print(0)
    st = -1
    for i, s in enumerate(S):
        if s == "#":
            st = i
            break
    ans = S[st:].count(".")  # from 白 to 黒
    st = -1
    flag = False
    for i, s in enumerate(S[::-1]):
        if not(flag) and s == ".":
            flag = True
        if flag and s == "#":
            st = -(i+1)
            break
    ans = min(ans, S[:st].count("#") + 1)
    print(ans)


if __name__ == '__main__':
    main()
