Codeforces Round 340 (Div. 2)
D
Polyline
Codeforces
1700
原题
← CE →
翻译中…

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 $*x*_{*i*}$ and $*y*_{*i*}$ ($- 10^{9} ≤ *x*_{*i*}, *y*_{*i*} ≤ 10^{9}$) — 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.

翻译中…

Note

翻译中…

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

翻译中…

样例

Input #1
1 -1
1 1
1 2
Output #1
1
InputCopy OutputCopy
Input #2
-1 -1
-1 3
4 3
Output #2
2
InputCopy OutputCopy
Input #3
1 1
2 3
3 2
Output #3
3
InputCopy OutputCopy
题目信息
题号
617D
时间限制
1 s
内存限制
256 MB
标签
构造
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。