Problem: Maria participates in a bicycle race.

The speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of straight sections, directed to the north, south, east or west.

Let's introduce a system of coordinates, directing the Ox axis from west to east, and the Oy axis from south to north. As a starting position of the race the southernmost point of the track is selected (and if there are several such points, the most western among them). The participants start the race, moving to the north. At all straight sections of the track, the participants travel in one of the four directions (north, south, east or west) and change the direction of movement only in bends between the straight sections. The participants, of course, never turn back, that is, they do not change the direction of movement from north to south or from east to west (or vice versa).

Maria is still young, so she does not feel confident at some turns. Namely, Maria feels insecure if at a failed or untimely turn, she gets into the water. In other words, Maria considers the turn dangerous if she immediately gets into the water if it is ignored.

Help Maria get ready for the competition — determine the number of dangerous turns on the track.

Input

The first line of the input contains an integer n (4 ≤ n ≤ 1000) — the number of straight sections of the track.

The following (n + 1)-th line contains pairs of integers (xi, yi) ( - 10 000 ≤ xi, yi ≤ 10 000). The first of these points is the starting position. The i-th straight section of the track begins at the point (xi, yi) and ends at the point (xi + 1, yi + 1).

It is guaranteed that:

  * the first straight section is directed to the north; 
  * the southernmost (and if there are several, then the most western of among them) point of the track is the first point; 
  * the last point coincides with the first one (i.e., the start position); 
  * any pair of straight sections of the track has no shared points (except for the neighboring ones, they share exactly one point); 
  * no pair of points (except for the first and last one) is the same; 
  * no two adjacent straight sections are directed in the same direction or in opposite directions. 

Output

Print a single integer — the number of dangerous turns on the track.

Examples

Input

6
0 0
0 1
1 1
1 2
2 2
2 0
0 0


Output

1


Input

16
1 1
1 5
3 5
3 7
2 7
2 9
6 9
6 7
5 7
5 3
4 3
4 4
3 4
3 2
5 2
5 1
1 1


Output

6

Note

The first sample corresponds to the picture:

<image>

The picture shows that you can get in the water under unfortunate circumstances only at turn at the point (1, 1). Thus, the answer is 1.

Solution (in PYTHON3):

Solution:
#------------------Important Modules------------------#
from sys import stdin,stdout
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import *
from random import *
from itertools import permutations
input=stdin.readline
prin=stdout.write
from random import sample
from collections import Counter,deque
from fractions import *
from math import sqrt,ceil,log2,gcd,cos,pi,floor
from copy import deepcopy
#dist=[0]*(n)
mod=10**9+7
mod2=998244353
def ps(n):
    cp=0;lk=0;arr={}
    lk=0;ap=n
    cc=0
    while n%2==0:
        n=n//2
        cc=1
    if cc==1:
        lk+=1
        
    
    
    
        
    for ps in range(3,ceil(sqrt(n))+1,2):
        #print(ps)
        cc=0
        while n%ps==0:
            n=n//ps
            cc=1

        lk+=1 if cc==1 else 0
        
            
            
    if n!=1:
        lk+=1
    
    if lk==1:    
        return False
        
    
    #print(arr)
    
    return True


#count=0
#dp=[[0 for i in range(m)] for j in range(n)]
#[int(x) for x in input().strip().split()]
def gcd(x, y): 
      
    while(y): 
        x, y = y, x % y 
      
    return x 
          
# Driver Code         
def factorials(n,r):
    #This calculates ncr mod 10**9+7
    slr=n;dpr=r
    qlr=1;qs=1
    mod=10**9+7
    
    for ip in range(n-r+1,n):
        qlr=(qlr*ip)%mod
    for ij in range(1,r):
        qs=(qs*ij)%mod
    #print(qlr,qs)
    ans=(qlr*modInverse(qs))%mod
    return ans

        
        
def modInverse(b):
    qr=10**9+7
    return pow(b, qr - 2,qr)

#===============================================================================================
### START ITERATE RECURSION ###
from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
def power(arr):
  listrep = arr
  subsets = []
  for i in range(2**len(listrep)):
    subset = []
    for k in range(len(listrep)):            
      if i & 1<<k:
        subset.append(listrep[k])
    subsets.append(subset)        
  return subsets
def pda(n) :
    list=[];su=0
    for i in range(1, int(sqrt(n) + 1)) :
         if (n % i == 0) :
            if (n // i == i) :
                list.append(i)
                su+=i
            else :
                list.append(n//i);list.append(i)
                su+=i;su+=n//i
    # The list will be printed in reverse    
    return su
def dis(xa,ya,xb,yb):
    return sqrt((xa-xb)**2+(ya-yb)**2)
#### END ITERATE RECURSION ####

 
#===============================================================================================
#----------Input functions--------------------#
def ii():
    return int(input())
def ilist():
    return [int(x) for x in input().strip().split()]
def islist():
    return list(map(str,input().split().rstrip()))
def inp():
    return input().strip()
def google(test):
    return "Case #"+str(test)+": ";
def overlap(x1,y1,x2,y2):
    if x2>y1:
        return y1-x2
    if y1>y2:
        return y2-x2
    return y1-x2;


###-------------------------CODE STARTS HERE--------------------------------###########

        
    

def dist(x1,y1,x2,y2):
    return sqrt((x1-x2)**2+(y1-y2)**2)
def sieve(n):
      
    
    prime = [True for i in range(n + 1)]
    p = 2
    while (p * p <= n):
          
        
        if (prime[p] == True):
              
            
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 1
    prime[0]= False
    prime[1]= False
    ans=[]
    for i in range(1,n+1):
        if prime[i]:
            ans.append(i)
    return ans
        
            
def prod(arr):
    n=len(arr)
    k=1
    for j in range(n):
        k*=arr[j]
    return k
def SumOfDigits(s):
    su=0
    while (s):
        su+=s%10
        s=s//10
    return su        
    
#########################################################################################
#def valid(sec,hr,min,nano):
    
#t=int(input())
t=1


for pl in range(t):
    n=ii()
    arr=[]
    for i in range(n+1):
        brr=ilist()
    print(floor((n-4)/2))