def main(word):
    strs = list(word)

    count = 0
    for i, _ in enumerate(strs):
        if i == 0:
            continue
        if strs[i] == "." and strs[i-1] == "#":
            count += 1

    return count


if __name__ == "__main__":
    input()
    word = input()
    print(main(word))
