403753: GYM101257 E Another Step-by-Step Pupil

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Another Step-by-Step Pupiltime limit per test0.25 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Hamza is a new intern at Mixed Dimensions, and he's learning the basics about 3D models. Hasan gave him an easy task on his first day, he has to count the number of boundary edges in a 3D mesh.

A boundary edge in a 3D mesh is an edge that is a part of only one triangle. Hamza got so confused, and asked Hasan to simplify the problem. Hasan decided to give him only two triangles. But he still can’t figure it out. Given the names of the vertices that make up the two triangles, can you help Hamza find the number of boundary edges in the two triangles?

Input

The input consists of two lines, each line describes one triangle, and contains 3 distinct integers from 1 to 6 which represent the names of the vertices of each triangle. It is guaranteed that the two triangles are different by at least one vertex.

Output

Print one integer, the number of boundary edges in the two given triangles.

ExamplesInput
3 5 2
3 1 2
Output
4
Input
6 1 4
5 2 3
Output
6
Note

The first sample results in the following 2 triangles with 4 boundary edges (in green):

加入题单

算法标签: