<>=~/ (.+) (.+) /;$\=0;for$x($`..$1){for($2..$'){$\++if$x!=$_}}print