Sonya decided that having her own hotel business is the best way of earning money because she can profit and rest wherever she wants.

The country where Sonya lives is an endless line. There is a city in each integer coordinate on this line. She has $n$ hotels, where the $i$-th hotel is located in the city with coordinate $x_i$. Sonya is a smart girl, so she does not open two or more hotels in the same city.

Sonya understands that her business needs to be expanded by opening new hotels, so she decides to build one more. She wants to make the minimum distance from this hotel to all others to be equal to $d$. The girl understands that there are many possible locations to construct such a hotel. Thus she wants to know the number of possible coordinates of the cities where she can build a new hotel. 

Because Sonya is lounging in a jacuzzi in one of her hotels, she is asking you to find the number of cities where she can build a new hotel so that the minimum distance from the original $n$ hotels to the new one is equal to $d$.


-----Input-----

The first line contains two integers $n$ and $d$ ($1\leq n\leq 100$, $1\leq d\leq 10^9$) — the number of Sonya's hotels and the needed minimum distance from a new hotel to all others.

The second line contains $n$ different integers in strictly increasing order $x_1, x_2, \ldots, x_n$ ($-10^9\leq x_i\leq 10^9$) — coordinates of Sonya's hotels.


-----Output-----

Print the number of cities where Sonya can build a new hotel so that the minimum distance from this hotel to all others is equal to $d$.


-----Examples-----
Input
4 3
-3 2 9 16

Output
6

Input
5 2
4 8 11 18 19

Output
5



-----Note-----

In the first example, there are $6$ possible cities where Sonya can build a hotel. These cities have coordinates $-6$, $5$, $6$, $12$, $13$, and $19$.

In the second example, there are $5$ possible cities where Sonya can build a hotel. These cities have coordinates $2$, $6$, $13$, $16$, and $21$.

Difficulty: interview

Starter code:

Solutions:
read = lambda: map(int, input().split())
n, d = read()
x = sorted(read())
ans = 2
for i in range(1, n):
    dx = x[i] - x[i - 1]
    if dx == 2 * d:
        ans += 1
    elif dx > 2 * d:
        ans += 2
print(ans)

n, d = list(map(int, input().split()))
a = list(map(int, input().split()))


cands = set()
for x in a:
    cands.add(x - d)
    cands.add(x + d)

ans = 0
for x in cands:
    mn_dist = min([abs(t - x) for t in a])
    ans += mn_dist == d

print(ans)


n,d=list(map(int,input().split()))
a=list(map(int,input().split()))
ans=2
for i in range(n-1):
	if a[i+1]-a[i]==2*d:
		ans+=1
	elif a[i+1]-a[i]>2*d:
		ans+=2
print(ans)

n, d = map(int, input().split())
x = list(map(int, input().split()))
ans = 2
for i in range(n - 1):
    if x[i + 1] - x[i] > 2 * d: ans += 2
    elif x[i + 1] - x[i] == 2 * d: ans += 1
print(ans)

n, d = [int(x) for x in input().strip().split()]
x = [int(x) for x in input().strip().split()]

d *= 2
x.sort()

ans = 2
for i in range(len(x) - 1):
    diff = x[i+1] - x[i]
    if diff == d:
        ans += 1
    elif diff > d:
        ans += 2

print(ans)


from sys import stdin, stdout
from collections import deque

n, d = map(int, stdin.readline().split())
values = list(map(int, stdin.readline().split()))
ans = set()

for i in range(n):
    cur = values[i] - d
    mn = 10 ** 10
    
    for j in range(n):
        if abs(cur - values[j]) < mn:
            mn = abs(cur- values[j])
    
    if mn == d:
        ans.add(cur)
        
    
    cur = values[i] + d
    mn = 10 ** 10
    
    for j in range(n):
        if abs(cur - values[j]) < mn:
            mn = abs(cur- values[j])
    
    if mn == d:
        ans.add(cur)  

stdout.write(str(len(ans)))

def main():
    #string     input()
    #strList    input().split()
    #integer    int(input())
    n, d = list(map(int, input().split()))
    x = list(map(int, input().split()))
    ret = 2
    for i in range(n - 1):
        if x[i + 1] - x[i] >= 2 * d:
            ret += 1 + (x[i + 1] - x[i] >= 2 * d + 1)
    print(ret)
    return 0
main()


n, d = [int(v) for v in input().split()]
a = {int(v) for v in input().split()}

b1 = {v - d for v in a}
b2 = {v + d for v in a}
s = (b1 | b2) - a

s = {v for v in b1 | b2 if min(abs(v - vv) for vv in a) == d}

print(len(s))


n,m = list(map(int,input().split()))
a = list(map(int,input().split()))
t = 2
for i in range(1,n):
    di = a[i]-a[i-1]
    if(di==2*m):t+=1
    if(di>2*m):t+=2
print(t)


n, d = list(map(int, input().split()))
koord = list(map(int, input().split()))
ans = 2
sums = []
for i in range(1, n):
    sums.append(koord[i] - koord[i - 1])
for i in sums:
    if i > 2 * d:
        ans += 2
    elif i == 2 * d:
        ans += 1
print(ans)
        



n, d = list(map(int,input().split()))

data = list(map(int,input().split()))

ans = 1

for i in range(n):
    if i == 0:
        ans += 1
        continue
    if (data[i] - data[i - 1] >= 2*d):
        if data[i] - data[i - 1] != 2 * d:
            ans += 2
        else:
            ans +=1
            
print(ans)


n,d=input().split()
n=int(n)
d=int(d)
a=list(map(int,input().split()))
t=2
for i in range(n-1):
    if a[i+1]-a[i]>2*d:
        t+=2
    elif a[i+1]-a[i]==2*d:
        t+=1
print(t)


n, d = map(int, input().split())
a = list(map(int, input().split()))

l = set()
for i in a:
    x = i + d
    r = 100000000000
    for j in a:
        r = min(abs(x - j), r)
    if r == d:
        l.add(x)
    x = i - d
    r = 100000000000
    for j in a:
        r = min(abs(x - j), r)
    if r == d:
        l.add(x)
print(len(l))

def ii():
    return int(input())
def mi():
    return map(int, input().split())
def li():
    return list(mi())

n, d = mi()
a = li()
a.sort()
ans = set()
for i in range(n):
    x = a[i] - d
    y = a[i] + d
    if i == 0 or a[i - 1] <= x - d:
        ans.add(x)
    if i == n - 1 or y + d <= a[i + 1]:
        ans.add(y)
print(len(ans))

n, d = list(map(int, input().split()))
x = list(map(int, input().split()))

ans = 2
for i in range(n - 1):
    if x[i + 1] - x[i] == 2 * d:
        ans += 1
    elif x[i + 1] - x[i] > 2 * d:
        ans += 2
print(ans)


#!/usr/bin/env python3

n, d = [int(i) for i in input().split()]

x = [int(i) for i in input().split()]

ans = 2
for i in range(1, len(x)):
    if x[i] - x[i - 1] == 2 * d:
        ans += 1
    if x[i] - x[i - 1] > 2 * d:
        ans += 2
print(ans)



n,d=map(int,input().strip().split())
city=list(map(int,input().strip().split()))
count=2
for i in range(1,n):
	if city[i]-city[i-1]==2*d:
		count=count+1
	elif city[i]-city[i-1]>2*d:
		count=count+2
	else:
		continue
print (count)

n, d = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
a = [-10**10] + a + [10**10]
ans = 0
for i in range(1, n+1):
    if(abs((a[i] - d) - a[i-1]) >= d):
        if abs((a[i] - d) - a[i-1]) != d:
            ans += 1
    if (abs((a[i] + d) - a[i+1]) >= d):
        ans += 1
print(ans)


from sys import stdin, stdout 
from bisect import bisect_left, bisect_right
from collections import defaultdict
import math
from random import random
cin = stdin.readline
def cout(x):
	stdout.write(str(x)+'\n')
def var(type = int):
    return type(stdin.readline())
def readline(type = int):
    return map(type,stdin.readline().split())
def readlist(type = int):
    return list(map(type,stdin.readline().split()))
def sorted_indexes(arr):
    return sorted(range(len(arr)),key=arr.__getitem__)
def printr(arr):
    [stdout.write(str(x)+' ')   for x in arr]
    cout('')
def find_lt(a, x):#'Find rightmost value less than x'
    i = bisect_left(a, x)
    if i:
        return a[i-1]
    raise ValueError
def find_gt(a, x):#'Find leftmost value greater than x'
    i = bisect_right(a, x)
    if i != len(a):
        return a[i]
    raise ValueError
def dist(x,y):
    return math.sqrt(x*x + y*y)
def binary_search(arr, x):
    i = bisect_left(arr, x)
    if i == len(arr) or arr[i] != x:
        return -1
    return i

# ---------------------Template ends-------------sdpt,sdpt131[Sudipta Banik]---------------------

n,d = readline()
a = readlist()

mp = {}
for i in range(n):
	left = a[i]-d;
	right = a[i]+d;
	if (i==0):
		mp[left]=1
	else:
		if abs(left - a[i-1])>=d:
			mp[left]=1
		else:
			pass

	if i==n-1:
		mp[right]=1
	else:
		if(abs(right - a[i+1]))>=d:
			mp[right]=1
		else:
			pass
print(len(mp))

import sys

n, d = [int(x) for x in input().split()]
x = [int(x) for x in input().split()]

res = 2

for i in range(len(x)):
    if i > 0 and abs(x[i] - d - x[i-1]) >= d:
        res += 1
    if i < len(x) - 1 and abs(x[i] + d - x[i+1]) > d:
        res += 1

print(res)


n, m  = [int(el) for el in input().split()]
col = 2
a = [int(el) for el in input().split()]
for i in range(n - 1):
    if a[i + 1] - a[i] == m * 2:
        col += 1
    if a[i+1] - a[i] > m*2:
        col += 2
print(col)


n,d=list(map(int,input().split()))
a=sorted(list(map(int,input().split())))
ans=2
for i in range(1,n):
    if(a[i]-a[i-1]-2*d>0):
        ans+=2
    elif(a[i]-a[i-1]-2*d==0):
        ans+=1
print(ans)

n, d = map(int, input().split())
a = list(map(int, input().split()))
ans = 2
for i in range(n - 1):
    if a[i + 1] - a[i] > 2 * d:
        ans += 2
    elif a[i + 1] - a[i] == 2 * d:
        ans += 1
print(ans)

n, d = input().split(" ")
n = int(n)
d = int(d)
x = input().split(" ")
for i in range(n):
    x[i] = int(x[i])
counter = 2
for i in range(n - 1):
    start = x[i]
    end = x[i + 1]
    if end - start < 2 * d:
        counter += 0
    elif end - start == 2 * d:
        counter += 1
    else:
        counter += 2
print(counter)