from math import sin, cos, tan, asin, acos, atan, sqrt, floor, ceil, pi, log10, log, gcd
from itertools import accumulate, permutations, combinations
from collections import deque, defaultdict, Counter
from bisect import bisect_left, bisect_right
import pprint
from copy import deepcopy
from decimal import Decimal
import heapq
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
print = pprint.pprint


class Data():
        def __init__(self):
                self.power = 1
                self.rev = 1


class Combi():
        def __init__(self, N, mod):
                self.lists = [Data() for _ in range(N+1)]
                self.mod = mod
                for i in range(2, N+1):
                        self.lists[i].power = ((self.lists[i-1].power)*i) % self.mod
                self.lists[N].rev = pow(self.lists[N].power, self.mod-2, self.mod)
                for j in range(N, 0, -1):
                        self.lists[j-1].rev = ((self.lists[j].rev)*j) % self.mod

        def combi(self, K, R):
                if K < R:
                        return 0
                else:
                        return ((self.lists[K].power)*(self.lists[K-R].rev)*(self.lists[R].rev)) % self.mod


class Dijkstra():

        class Edge():
                """ 重み付き有向辺 """

                def __init__(self, _to, _cost):
                        self.to = _to
                        self.cost = _cost

        def __init__(self, V):
                """
                Args:
                        V(int): 頂点の数
                """
                self.G = [[] for i in range(V)]  # 隣接リストG[u][i] := 頂点uのi個目の隣接辺
                self._E = 0  # 辺の数
                self._V = V  # 頂点の数

        @property
        def E(self):
                """ 辺数 """
                return self._E

        @property
        def V(self):
                """ 頂点数 """
                return self._V

        def add(self, _from, _to, _cost):
                """ 2頂点と、辺のコストを追加する """
                self.G[_from].append(self.Edge(_to, _cost))
                self._E += 1

        def shortest_path(self, s):
                """ 始点sから頂点iまでの最短路を格納したリストを返す
                """
                import heapq
                que = []
                heapq.heapify(que)
                d = [float("inf")] * self.V
                d[s] = 0
                heapq.heappush(que, (0, s))  # 始点の(最短距離, 頂点番号)をヒープに追加

                while len(que) != 0:
                        cost, v = heapq.heappop(que)
                        if d[v] < cost:
                                continue

                        for i in range(len(self.G[v])):
                                e = self.G[v][i]  # vのi個目の隣接辺e
                                if d[e.to] > d[v] + e.cost:
                                        d[e.to] = d[v] + e.cost
                                        heapq.heappush(que, (d[e.to], e.to))
                return d


def warshall_floyd(d):
        # d[i][j]=i番目の頂点からj番目の頂点までの最短距離
        n = len(d[0])-1
        for i in range(n+1):
                d[i][i] = 0  # 自身のところに行くコストは０
        for k in range(1, n+1):
                for i in range(1, n+1):
                        for j in range(1, n+1):
                                d[i][j] = min(d[i][j], d[i][k] + d[k][j])
        return d


def kruskal(edge, N):
        res = 0
        node = []
        edge.sort()
        G = UnionFind(N)
        for cost, p, q, in edge:
                if not G.same(p, q):
                        G.union(p, q)
                        node.add((cost, p, q))
                        res += cost
        return res, node


def bellman_ford(s, graph, n):
        dist = [10**20 for i in range(n+1)]
        dist[s] = 0
        for i in range(1, n+1):
                flag = False
                for some in graph:
                        a, b, d = some[0], some[1], some[2]
                        newlen = dist[a]+d
                        if newlen < dist[b]:
                                flag = True
                                dist[b] = newlen
                if not flag:
                        break
                if i == n:
                        print("There is a negative circle!")
        return dist


class LCA_Tree():
        # 頂点は0スタートでも1スタートでもいい
        # 頂点の個数だけは記録しておく。　セグメント木の実装verをしてもいいかもしれないけど、こっちのが十分早そうｗ

        def bfs(self, node):
                # 初期化補助関数
                self.visited[node] = True
                for p in tree[node]:
                        if self.visited[p] == False:
                                self.kprv[0][p] = node
                                self.depth[p] = self.depth[node]+1
                                self.bfs(p)

        def __init__(self, root, tree):
                self.root = root
                self.n = len(tree)-1
                self.K = (self.n-1).bit_length()
                self.visited = [False for i in range(self.n+1)]
                self.depth = [0 for i in range(self.n+1)]
                self.kprv = [[-1 for i in range(self.n+1)] for j in range(self.K+1)]
                self.bfs(self.root)
                for cnt in range(1, self.K+1):
                        for node in range(self.n+1):
                                if self.kprv[cnt-1][node] >= 0:
                                        self.kprv[cnt][node] = self.kprv[cnt -
                                                                                                        1][self.kprv[cnt-1][node]]
                                else:
                                        self.kprv[cnt][node] = -1

        def query(self, u, v):
                # u,vの最小共通祖先

                dd = self.depth[v]-self.depth[u]

                if dd < 0:
                        u, v = v, u
                        dd = -dd

                for i in range(self.K+1):
                        if dd & 1:
                                v = self.kprv[i][v]
                        dd >>= 1
                if u == v:
                        return u

                for i in range(self.K-1, -1, -1):
                        pu = self.kprv[i][u]
                        pv = self.kprv[i][v]
                        if pu != pv:
                                u = pu
                                v = pv
                return self.kprv[0][u]


class UnionFind():
        def __init__(self, n):
                self.n = n
                self.parents = [-1] * (n+1)

        def find(self, x):
                if self.parents[x] < 0:
                        return x
                else:
                        self.parents[x] = self.find(self.parents[x])
                        return self.parents[x]

        def union(self, x, y):
                x = self.find(x)
                y = self.find(y)

                if x == y:
                        return

                if self.parents[x] > self.parents[y]:
                        x, y = y, x

                self.parents[x] += self.parents[y]
                self.parents[y] = x

        def size(self, x):
                return -self.parents[self.find(x)]

        def same(self, x, y):
                return self.find(x) == self.find(y)

        def members(self, x):
                root = self.find(x)
                return [i for i in range(self.n + 1) if self.find(i) == root]

        def roots(self):
                return [i for i, x in enumerate(self.parents) if x < 0]

        def group_count(self):
                return len(self.roots())

        def all_group_members(self):
                return {r: self.members(r) for r in self.roots()}

        def __str__(self):
                return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


class UnionFindLabel(UnionFind):
        def __init__(self, labels):
                assert len(labels) == len(set(labels))

                self.n = len(labels)
                self.parents = [-1] * self.n
                self.d = {x: i for i, x in enumerate(labels)}
                self.d_inv = {i: x for i, x in enumerate(labels)}

        def find_label(self, x):
                return self.d_inv[super().find(self.d[x])]

        def union(self, x, y):
                super().union(self.d[x], self.d[y])

        def size(self, x):
                return super().size(self.d[x])

        def same(self, x, y):
                return super().same(self.d[x], self.d[y])

        def members(self, x):
                root = self.find(self.d[x])
                return [self.d_inv[i] for i in range(self.n) if self.find(i) == root]

        def roots(self):
                return [self.d_inv[i] for i, x in enumerate(self.parents) if x < 0]


class BIT:
        # 1,,,,,,,Nまでの数値を扱える
        def __init__(self, n):
                self.n = n
                self.data = [0]*(n+1)

        def to_sum(self, i):
                # i番目のところまで要素を足し合わせる
                s = 0
                while i > 0:
                        s += self.data[i]
                        i -= (i & -i)
                return s

        def add(self, i, x):
                # i 番目のところに要素を足し合わせる
                while i <= self.n:
                        self.data[i] += x
                        i += (i & -i)

        def get(self, i, j):
                # i番目からj番目までの要素の合計値を数える(1<=i<=j<=Nという制約がついているけど)
                return self.to_sum(j)-self.to_sum(i-1)


class SegTree():
        # 1-indexed
        def __init__(self, lists, function, basement):
                self.n = len(lists)
                self.K = (self.n-1).bit_length()
                self.f = function
                self.b = basement
                self.seg = [basement]*(2**(self.K+1)+1)
                X = 2**self.K
                for i, v in enumerate(lists):
                        self.seg[i+X] = v
                for i in range(X-1, 0, -1):
                        self.seg[i] = self.f(self.seg[i << 1], self.seg[i << 1 | 1])

        def update(self, k, value):
                X = 2**self.K
                k += X
                self.seg[k] = value
                while k:
                        k = k >> 1
                        self.seg[k] = self.f(self.seg[k << 1], self.seg[(k << 1) | 1])

        def query(self, L, R):
                num = 2**self.K
                L += num
                R += num
                vL = self.b
                vR = self.b
                while L < R:
                        if L & 1:
                                vL = self.f(vL, self.seg[L])
                                L += 1
                        if R & 1:
                                R -= 1
                                vR = self.f(self.seg[R], vR)
                        L >>= 1
                        R >>= 1
                return self.f(vL, vR)

        def find_max_index(self, L, R, X):
                # [L,R)でX以下の物で最大indexを取得
                return self.fMi(L, R, X, 1, 0, 2**self.K)

        def find_min_index(self, L, R, X):
                # [L,R) でX以下の物で最小のindexを取得する
                return self.fmi(L, R, X, 1, 0, 2**self.K)

        def fMi(self, a, b, x, k, l, r):
                if self.seg[k] > x or r <= a or b <= l:
                        # X以上のもの、の時は不等号をself.seg[k]<xにする
                        return -1
                else:
                        if k >= 2**self.K:
                                return k-2**self.K
                        else:
                                vr = self.fMi(a, b, x, (k << 1) | 1, (l + r) // 2, r)
                                if vr != -1:
                                        return vr
                                return self.fMi(a, b, x, k << 1, l, (l + r) // 2)

        def fmi(self, a, b, x, k, l, r):
                if self.seg[k] > x or r <= a or b <= l:
                        # X以上のもの、の時は不等号をself.seg[k]<xにする
                        return -1
                else:
                        if k >= 2**self.K:
                                return k-2**self.K
                        else:
                                vl = self.fmi(a, b, x, k << 1, l, (l+r)//2)
                                if vl != -1:
                                        return vl
                                return self.fmi(a, b, x, k << 1 | 1, (l+r)//2, r)


def count_inversion(lists):
        ans = 0
        N = len(lists)
        tree = BIT(N)
        for index, p in enumerate(lists):
                tree.add(p, 1)
                ans += index+1-tree.to_sum(p)
        return ans

# mod M における　aの逆元を求めてくれる


def xgcd(a, b):
        x0, y0, x1, y1 = 1, 0, 0, 1
        while b != 0:
                q, a, b = a // b, b, a % b
                x0, x1 = x1, x0 - q * x1
                y0, y1 = y1, y0 - q * y1
        return a, x0, y0

# すなわちax==1(mod m)なる自然数xを返してくれる関数 動作時間:logM


def modinv(a, m):
        g, x, y = xgcd(a, m)
        if g != 1:
                return False
        else:
                return x % m


def union_lcm(lists):
        if len(lists) == 1:
                return lists[0]
        elif len(lists) > 1:
                num = lists[0]
                for i in range(1, len(lists)):
                        num = num*lists[i]//gcd(num, lists[i])
                return num


# 最大公約数
def union_gcd(lists):
        if len(lists) == 1:
                return lists[0]
        elif len(lists) > 1:
                num = lists[0]
                for i in range(1, len(lists)):
                        num = gcd(num, lists[i])
                return num

# あるxをｋ進法において表された文字列stringにして返す関数


def trans(x, k):
        string = ""
        while x != 0:
                u, v = divmod(x, k)
                string = str(v)+string
                x = u
        return string


def trans(X, K):
        # K進数で変換.負の数に対応。(K<-1)
        if 0 < X < -K:
                return str(X)
        if X == 0:
                return "0"
        U, V = divmod(X, K)
        if V < 0:
                U += 1
                return trans(U, K)+str(V-K)
        else:
                return trans(U, K)+str(V)


def prime_list(n):
        prime = {i for i in range(2, n)}
        for i in range(2, n):
                if i in prime:
                        for j in range(i*2, n, i):
                                if j in prime:
                                        prime.remove(j)
        return prime


def is_prime(N):
        if N == 1:
                return False
        i = 2
        while i**2 <= N:
                if N % i == 0:
                        return False
                i += 1
        return True


def super_factorization(N):
        # 1からNまでの整数を素因数分解した形で返す
        spf = [i for i in range(N+1)]
        # spf[X]=Xにおいて、Xのもつ最も小さい素因数
        # N以下の素数を全て求める
        prime = {i for i in range(2, N+1)}

        for i in range(2, N+1):
                if i in prime:
                        for j in range(i*2, N+1, i):
                                if j in prime:
                                        spf[j] = i
                                        prime.remove(j)

        result = [{} for _ in range(N+1)]
        # result[i]=iを素因数分解した時の因数を加える(i==0の時はNULL)
        for i in range(2, N+1):
                div = spf[i]
                if div == 1:
                        result[i] = {i: 1}
                else:
                        y = i//div
                        result[i] = result[y].copy()
                        if div in result[i].keys():
                                result[i][div] += 1
                        else:
                                result[i][div] = 1
        return result
def main():
    #start coding here...
    a,b,c,d,e=list(map(int,input().split()))
    print(15-a-b-c-d-e)
if __name__=="__main__":
    main()

Measured memory_bytes: 10676