Polyline

TimeLimit:1000MS  MemoryLimit:256MB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description

There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments parallel to the coordinate axes. You are to find the minimum number of segments this polyline may consist of.

Input

Each of the three lines of the input contains two integers. The i-th line contains integers xi and yi ( - 109 ≤ xi, yi ≤ 109) — the coordinates of the i-th point. It is guaranteed that all points are distinct.

Output

Print a single number — the minimum possible number of segments of the polyline.

SampleInput 1
1 -1
1 1
1 2
SampleOutput 1
1
SampleInput 2
-1 -1
-1 3
4 3
SampleOutput 2
2
SampleInput 3
1 1
2 3
3 2
SampleOutput 3
3
Note

The variant of the polyline in the first sample: The variant of the polyline in the second sample: The variant of the polyline in the third sample:

Submit
题目统计信息详细
总AC数10
通过人数9
尝试人数16
总提交量61
AC率14.75%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: