{"problem":{"name":"Made Up","description":{"content":"Given are three sequences of length $N$ each: $A = (A_1, A_2, \\dots, A_N)$, $B = (B_1, B_2, \\dots, B_N)$, and $C = (C_1, C_2, \\dots, C_N)$, consisting of integers between $1$ and $N$ (inclusive). How ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc202_c"},"statements":[{"statement_type":"Markdown","content":"Given are three sequences of length $N$ each: $A = (A_1, A_2, \\dots, A_N)$, $B = (B_1, B_2, \\dots, B_N)$, and $C = (C_1, C_2, \\dots, C_N)$, consisting of integers between $1$ and $N$ (inclusive).\nHow many pairs $(i, j)$ of integers between $1$ and $N$ (inclusive) satisfy $A_i = B_{C_j}$?\n\n## Constraints\n\n*   $1 \\leq N \\leq 10^5$\n*   $1 \\leq A_i, B_i, C_i \\leq N$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n$B_1$ $B_2$ $\\ldots$ $B_N$\n$C_1$ $C_2$ $\\ldots$ $C_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc202_c","tags":[],"sample_group":[["3\n1 2 2\n3 1 2\n2 3 2","4\n\nFour pairs satisfy the condition: $(1, 1), (1, 3), (2, 2), (3, 2)$."],["4\n1 1 1 1\n1 1 1 1\n1 2 3 4","16\n\nAll the pairs satisfy the condition."],["3\n2 3 3\n1 3 3\n1 1 1","0\n\nNo pair satisfies the condition."]],"created_at":"2026-03-03 11:01:14"}}