{"raw_statement":[{"iden":"problem statement","content":"We have $N$ dishes numbered $1, 2, \\dots, N$ and $M$ conditions numbered $1, 2, \\dots, M$.  \nCondition $i$ is satisfied when both Dish $A_i$ and Dish $B_i$ have (one or more) balls on them.  \nThere are $K$ people numbered $1, 2, \\dots, K$. Person $i$ will put a ball on Dish $C_i$ or Dish $D_i$.  \nAt most how many conditions will be satisfied?"},{"iden":"constraints","content":"*   All values in input are integers.\n*   $2 ≤ N ≤ 100$\n*   $1 ≤ M ≤ 100$\n*   $1 ≤ A_i < B_i ≤ N$\n*   $1 ≤ K ≤ 16$\n*   $1 ≤ C_i < D_i ≤ N$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $M$\n$A_1$ $B_1$\n$\\vdots$\n$A_M$ $B_M$\n$K$\n$C_1$ $D_1$\n$\\vdots$\n$C_K$ $D_K$"},{"iden":"sample input 1","content":"4 4\n1 2\n1 3\n2 4\n3 4\n3\n1 2\n1 3\n2 3"},{"iden":"sample output 1","content":"2\n\nFor example, if People $1, 2, 3$ put their balls on Dishes $1, 3, 2$, respectively, Conditions $1$ and $2$ will be satisfied."},{"iden":"sample input 2","content":"4 4\n1 2\n1 3\n2 4\n3 4\n4\n3 4\n1 2\n2 4\n2 4"},{"iden":"sample output 2","content":"4\n\nFor example, if People $1, 2, 3, 4$ put their balls on Dishes $3, 1, 2, 4$, respectively, all conditions will be satisfied."},{"iden":"sample input 3","content":"6 12\n2 3\n4 6\n1 2\n4 5\n2 6\n1 5\n4 5\n1 3\n1 2\n2 6\n2 3\n2 5\n5\n3 5\n1 4\n2 6\n4 6\n5 6"},{"iden":"sample output 3","content":"9"}],"translated_statement":null,"sample_group":[],"show_order":["render_html"],"formal_statement":null,"simple_statement":null,"has_page_source":true}