Dancing Queens

How many moves can the queens make?

Run 3

Input

__QQ____
________
________
________
___Q____
__Q_____
________
________

Expected Output

69