def min4(a, b, c, d):
    while not a <= b <= c <= d:
        if a > b:
            a, b = b, a
        if b > c:
            b, c = c, b
        if c > d:
            c, d = d, c
    print(a)


a = int(input())
b = int(input())
c = int(input())
d = int(input())
min4(a, b, c, d)

e52eed255f06d50890875572e0962c353aa23909
<mask token>

def min4(a, b, c, d):
    while not a <= b <= c <= d:
        if a > b:
            a, b = b, a
        if b > c:
            b, c = c, b
        if c > d:
            c, d = d, c
    print(a)


<mask token>

def min4(a, b, c, d):
    while not a <= b <= c <= d:
        if a > b:
            a, b = b, a
        if b > c:
            b, c = c, b
        if c > d:
            c, d = d, c
    print(a)


<mask token>
min4(a, b, c, d)

def min4(a, b, c, d):
    while not a <= b <= c <= d:
        if a > b:
            a, b = b, a
        if b > c:
            b, c = c, b
        if c > d:
            c, d = d, c
    print(a)


a = int(input())
b = int(input())
c = int(input())
d = int(input())
min4(a, b, c, d)
