import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Stream;

public class B_special8
{
	public static final long[] POWER2 = generatePOWER2();
	public static final IteratorBuffer<Long> ITERATOR_BUFFER_PRIME = new IteratorBuffer<>(streamPrime(1000000).iterator());
	private static BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
	private static StringTokenizer stringTokenizer = null;
	private static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

	interface BiFunctionResult<Type0, Type1, TypeResult>
	{
		TypeResult apply(Type0 x0, Type1 x1, TypeResult x2);
	}

	static class Array<Type> implements Iterable<Type>
	{
		private final Object[] array;

		public Array(int size)
		{
			this.array = new Object[size];
		}

		public Array(int size, Type element)
		{
			this(size);
			Arrays.fill(this.array, element);
		}

		public Array(Array<Type> array, Type element)
		{
			this(array.size() + 1);
			for (int index = 0; index < array.size(); index++)
			{
				set(index, array.get(index));
			}
			set(size() - 1, element);
		}

		public Array(List<Type> list)
		{
			this(list.size());
			int index = 0;
			for (Type element : list)
			{
				set(index, element);
				index += 1;
			}
		}

		public Type get(int index)
		{
			return (Type) this.array[index];
		}

		public Array set(int index, Type value)
		{
			this.array[index] = value;
			return this;
		}

		public int size()
		{
			return this.array.length;
		}

		public List<Type> toList()
		{
			List<Type> result = new ArrayList<>();
			for (Type element : this)
			{
				result.add(element);
			}
			return result;
		}

		@Override
		public Iterator<Type> iterator()
		{
			return new Iterator<Type>()
			{
				int index = 0;

				@Override
				public boolean hasNext()
				{
					return this.index < size();
				}

				@Override
				public Type next()
				{
					Type result = Array.this.get(index);
					index += 1;
					return result;
				}
			};
		}

		@Override
		public String toString()
		{
			return "[" + B_special8.toString(this, ", ") + "]";
		}
	}

	static class BIT
	{
		private static int lastBit(int index)
		{
			return index & -index;
		}

		private final long[] tree;

		public BIT(int size)
		{
			this.tree = new long[size];
		}

		public void add(int index, long delta)
		{
			index += 1;
			while (index <= this.tree.length)
			{
				tree[index - 1] += delta;
				index += lastBit(index);
			}
		}

		private long prefix(int end)
		{
			long result = 0;
			while (end > 0)
			{
				result += this.tree[end - 1];
				end -= lastBit(end);
			}
			return result;
		}

		public int size()
		{
			return this.tree.length;
		}

		public long sum(int start, int end)
		{
			return prefix(end) - prefix(start);
		}
	}

	static abstract class Edge<TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>>
	{
		public final TypeVertex vertex0;
		public final TypeVertex vertex1;
		public final boolean bidirectional;

		public Edge(TypeVertex vertex0, TypeVertex vertex1, boolean bidirectional)
		{
			this.vertex0 = vertex0;
			this.vertex1 = vertex1;
			this.bidirectional = bidirectional;
			this.vertex0.edges.add(getThis());
			if (this.bidirectional)
			{
				this.vertex1.edges.add(getThis());
			}
		}

		public TypeVertex other(Vertex<TypeVertex, TypeEdge> vertex)
		{
			TypeVertex result;
			if (vertex0 == vertex)
			{
				result = vertex1;
			}
			else
			{
				result = vertex0;
			}
			return result;
		}

		public abstract TypeEdge getThis();

		public void remove()
		{
			this.vertex0.edges.remove(getThis());
			if (this.bidirectional)
			{
				this.vertex1.edges.remove(getThis());
			}
		}

		@Override
		public String toString()
		{
			return this.vertex0 + "->" + this.vertex1;
		}
	}

	public static class EdgeDefault<TypeVertex extends Vertex<TypeVertex, EdgeDefault<TypeVertex>>> extends Edge<TypeVertex, EdgeDefault<TypeVertex>>
	{
		public EdgeDefault(TypeVertex vertex0, TypeVertex vertex1, boolean bidirectional)
		{
			super(vertex0, vertex1, bidirectional);
		}

		@Override
		public EdgeDefault<TypeVertex> getThis()
		{
			return this;
		}
	}

	public static class Vertex<TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>> implements Comparable<Vertex<? super TypeVertex, ? super TypeEdge>>
	{
		public static <TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>> void depthFirstSearch(
				Array<TypeVertex> vertices,
				int indexVertexStart,
				BiConsumer<TypeVertex, TypeEdge> functionPreVisit,
				BiConsumer<TypeVertex, TypeEdge> functionInVisit,
				BiConsumer<TypeVertex, TypeEdge> functionPostVisit
		)
		{
			TypeVertex vertexTo;
			TypeEdge edgeTo;
			boolean[] isOnStack = new boolean[vertices.size()];
			Stack<Operation> stackOperations = new Stack<>();
			Stack<TypeVertex> stackVertices = new Stack<>();
			Stack<TypeEdge> stackEdges = new Stack<>();

			TypeVertex vertexStart = vertices.get(indexVertexStart);
			stackOperations.push(Operation.EXPAND);
			stackVertices.push(vertexStart);
			stackEdges.push(null);
			isOnStack[vertexStart.index] = true;
			while (!stackOperations.isEmpty())
			{
				Operation operation = stackOperations.pop();
				TypeVertex vertex = stackVertices.pop();
				TypeEdge edge = stackEdges.pop();
				switch (operation)
				{
					case INVISIT:
						functionInVisit.accept(vertex, edge);
						break;
					case POSTVISIT:
						functionPostVisit.accept(vertex, edge);
						break;
					case EXPAND:
						stackOperations.push(Operation.POSTVISIT);
						stackVertices.push(vertex);
						stackEdges.push(edge);
						Integer indexTo = null;
						for (int index = 0; indexTo == null && index < vertex.edges.size(); index++)
						{
							edgeTo = vertex.edges.get(index);
							vertexTo = edgeTo.other(vertex);
							if (!isOnStack[vertexTo.index])
							{
								indexTo = index;
							}
						}
						if (indexTo != null)
						{
							edgeTo = vertex.edges.get(indexTo);
							vertexTo = edgeTo.other(vertex);
							stackOperations.push(Operation.EXPAND);
							stackVertices.push(vertexTo);
							stackEdges.push(edgeTo);
							isOnStack[vertexTo.index] = true;
							for (int index = indexTo + 1; index < vertex.edges.size(); index++)
							{
								edgeTo = vertex.edges.get(index);
								vertexTo = edgeTo.other(vertex);
								if (!isOnStack[vertexTo.index])
								{
									stackOperations.push(Operation.INVISIT);
									stackVertices.push(vertex);
									stackEdges.push(edge);
									stackOperations.push(Operation.EXPAND);
									stackVertices.push(vertexTo);
									stackEdges.push(edgeTo);
									isOnStack[vertexTo.index] = true;
								}
							}
						}
						functionPreVisit.accept(vertex, edge);
						break;
				}
			}
		}

		public static <TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>> void depthFirstSearch(
				Array<TypeVertex> vertices,
				int indexVertexStart,
				Consumer<TypeVertex> functionPreVisit,
				Consumer<TypeVertex> functionInVisit,
				Consumer<TypeVertex> functionPostVisit
		)
		{
			depthFirstSearch(
					vertices,
					indexVertexStart,
					(vertex, edge) -> functionPreVisit.accept(vertex),
					(vertex, edge) -> functionInVisit.accept(vertex),
					(vertex, edge) -> functionPostVisit.accept(vertex)
			);
		}

		public static <TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>, TypeResult> TypeResult breadthFirstSearch(
				TypeVertex vertex,
				TypeEdge edge,
				BiFunctionResult<TypeVertex, TypeEdge, TypeResult> function,
				Array<Boolean> visited,
				FIFO<TypeVertex> verticesNext,
				FIFO<TypeEdge> edgesNext,
				TypeResult result
		)
		{
			if (!visited.get(vertex.index))
			{
				visited.set(vertex.index, true);
				result = function.apply(vertex, edge, result);
				for (TypeEdge edgeNext : vertex.edges)
				{
					TypeVertex vertexNext = edgeNext.other(vertex);
					if (!visited.get(vertexNext.index))
					{
						verticesNext.push(vertexNext);
						edgesNext.push(edgeNext);
					}
				}
			}
			return result;
		}

		public static <TypeVertex extends Vertex<TypeVertex, TypeEdge>, TypeEdge extends Edge<TypeVertex, TypeEdge>, TypeResult> TypeResult breadthFirstSearch(
				Array<TypeVertex> vertices,
				int indexVertexStart,
				BiFunctionResult<TypeVertex, TypeEdge, TypeResult> function,
				TypeResult result
		)
		{
			Array<Boolean> visited = new Array<>(vertices.size(), false);
			FIFO<TypeVertex> verticesNext = new FIFO<>();
			verticesNext.push(vertices.get(indexVertexStart));
			FIFO<TypeEdge> edgesNext = new FIFO<>();
			edgesNext.push(null);
			while (!verticesNext.isEmpty())
			{
				result = breadthFirstSearch(verticesNext.pop(), edgesNext.pop(), function, visited, verticesNext, edgesNext, result);
			}
			return result;
		}

		public final int index;
		public final List<TypeEdge> edges;

		public Vertex(int index)
		{
			this.index = index;
			this.edges = new ArrayList<>();
		}

		@Override
		public int compareTo(Vertex<? super TypeVertex, ? super TypeEdge> that)
		{
			return Integer.compare(this.index, that.index);
		}

		@Override
		public String toString()
		{
			return "" + this.index;
		}

		enum Operation
		{
			INVISIT, POSTVISIT, EXPAND
		}
	}

	public static class VertexDefault<TypeEdge extends Edge<VertexDefault<TypeEdge>, TypeEdge>> extends Vertex<VertexDefault<TypeEdge>, TypeEdge>
	{
		public VertexDefault(int index)
		{
			super(index);
		}
	}

	public static class VertexDefaultDefault extends Vertex<VertexDefaultDefault, EdgeDefaultDefault>
	{
		public static Array<VertexDefaultDefault> vertices(int n)
		{
			Array<VertexDefaultDefault> result = new Array<>(n);
			for (int index = 0; index < n; index++)
			{
				result.set(index, new VertexDefaultDefault(index));
			}
			return result;
		}

		public VertexDefaultDefault(int index)
		{
			super(index);
		}
	}

	public static class EdgeDefaultDefault extends Edge<VertexDefaultDefault, EdgeDefaultDefault>
	{
		public EdgeDefaultDefault(VertexDefaultDefault vertex0, VertexDefaultDefault vertex1, boolean bidirectional)
		{
			super(vertex0, vertex1, bidirectional);
		}

		@Override
		public EdgeDefaultDefault getThis()
		{
			return this;
		}
	}

	public static class Tuple2<Type0, Type1>
	{
		public final Type0 v0;
		public final Type1 v1;

		public Tuple2(Type0 v0, Type1 v1)
		{
			this.v0 = v0;
			this.v1 = v1;
		}

		@Override
		public String toString()
		{
			return "(" + this.v0 + ", " + this.v1 + ")";
		}
	}

	static class Wrapper<Type>
	{
		public Type value;

		public Wrapper(Type value)
		{
			this.value = value;
		}

		public Type get()
		{
			return this.value;
		}

		public void set(Type value)
		{
			this.value = value;
		}

		@Override
		public String toString()
		{
			return this.value.toString();
		}
	}

	public static class Tuple3<Type0, Type1, Type2>
	{
		public final Type0 v0;
		public final Type1 v1;
		public final Type2 v2;

		public Tuple3(Type0 v0, Type1 v1, Type2 v2)
		{
			this.v0 = v0;
			this.v1 = v1;
			this.v2 = v2;
		}

		@Override
		public String toString()
		{
			return "(" + this.v0 + ", " + this.v1 + ", " + this.v2 + ")";
		}
	}

	public static class Tuple2Comparable<Type0 extends Comparable<? super Type0>, Type1 extends Comparable<? super Type1>> extends Tuple2<Type0, Type1> implements Comparable<Tuple2Comparable<Type0, Type1>>
	{
		public Tuple2Comparable(Type0 v0, Type1 v1)
		{
			super(v0, v1);
		}

		@Override
		public int compareTo(Tuple2Comparable<Type0, Type1> that)
		{
			int result = this.v0.compareTo(that.v0);
			if (result == 0)
			{
				result = this.v1.compareTo(that.v1);
			}
			return result;
		}
	}

	public static class SingleLinkedList<Type>
	{
		public final Type element;
		public SingleLinkedList<Type> next;

		public SingleLinkedList(Type element, SingleLinkedList<Type> next)
		{
			this.element = element;
			this.next = next;
		}

		public void toCollection(Collection<Type> collection)
		{
			if (this.next != null)
			{
				this.next.toCollection(collection);
			}
			collection.add(this.element);
		}
	}

	public static class Node<Type>
	{
		public static <Type> Node<Type> balance(Node<Type> result)
		{
			while (result != null && 1 < Math.abs(height(result.left) - height(result.right)))
			{
				if (height(result.left) < height(result.right))
				{
					Node<Type> right = result.right;
					if (height(right.right) < height(right.left))
					{
						result = new Node<>(result.value, result.left, right.rotateRight());
					}
					result = result.rotateLeft();
				}
				else
				{
					Node<Type> left = result.left;
					if (height(left.left) < height(left.right))
					{
						result = new Node<>(result.value, left.rotateLeft(), result.right);
					}
					result = result.rotateRight();
				}
			}
			return result;
		}

		public static <Type> Node<Type> clone(Node<Type> result)
		{
			if (result != null)
			{
				result = new Node<>(result.value, clone(result.left), clone(result.right));
			}
			return result;
		}

		public static <Type> Node<Type> delete(Node<Type> node, Type value, Comparator<? super Type> comparator)
		{
			Node<Type> result;
			if (node == null)
			{
				result = null;
			}
			else
			{
				int compare = comparator.compare(value, node.value);
				if (compare == 0)
				{
					if (node.left == null)
					{
						result = node.right;
					}
					else
					{
						if (node.right == null)
						{
							result = node.left;
						}
						else
						{
							Node<Type> first = first(node.right);
							result = new Node<>(first.value, node.left, delete(node.right, first.value, comparator));
						}
					}
				}
				else
				{
					if (compare < 0)
					{
						result = new Node<>(node.value, delete(node.left, value, comparator), node.right);
					}
					else
					{
						result = new Node<>(node.value, node.left, delete(node.right, value, comparator));
					}
				}
				result = balance(result);
			}
			return result;
		}

		public static <Type> Node<Type> first(Node<Type> result)
		{
			while (result.left != null)
			{
				result = result.left;
			}
			return result;
		}

		public static <Type> Node<Type> get(Node<Type> node, Type value, Comparator<? super Type> comparator)
		{
			Node<Type> result;
			if (node == null)
			{
				result = null;
			}
			else
			{
				int compare = comparator.compare(value, node.value);
				if (compare == 0)
				{
					result = node;
				}
				else
				{
					if (compare < 0)
					{
						result = get(node.left, value, comparator);
					}
					else
					{
						result = get(node.right, value, comparator);
					}
				}
			}
			return result;
		}

		public static <Type> Node<Type> head(Node<Type> node, Type value, Comparator<? super Type> comparator)
		{
			Node<Type> result;
			if (node == null)
			{
				result = null;
			}
			else
			{
				int compare = comparator.compare(value, node.value);
				if (compare == 0)
				{
					result = node.left;
				}
				else
				{
					if (compare < 0)
					{
						result = head(node.left, value, comparator);
					}
					else
					{
						result = new Node<>(node.value, node.left, head(node.right, value, comparator));
					}
				}
				result = balance(result);
			}
			return result;
		}

		public static int height(Node node)
		{
			return node == null ? 0 : node.height;
		}

		public static <Type> Node<Type> insert(Node<Type> node, Type value, Comparator<? super Type> comparator)
		{
			Node<Type> result;
			if (node == null)
			{
				result = new Node<>(value, null, null);
			}
			else
			{
				int compare = comparator.compare(value, node.value);
				if (compare == 0)
				{
					result = new Node<>(value, node.left, node.right);
					;
				}
				else
				{
					if (compare < 0)
					{
						result = new Node<>(node.value, insert(node.left, value, comparator), node.right);
					}
					else
					{
						result = new Node<>(node.value, node.left, insert(node.right, value, comparator));
					}
				}
				result = balance(result);
			}
			return result;
		}

		public static <Type> Node<Type> last(Node<Type> result)
		{
			while (result.right != null)
			{
				result = result.right;
			}
			return result;
		}

		public static int size(Node node)
		{
			return node == null ? 0 : node.size;
		}

		public static <Type> Node<Type> tail(Node<Type> node, Type value, Comparator<? super Type> comparator)
		{
			Node<Type> result;
			if (node == null)
			{
				result = null;
			}
			else
			{
				int compare = comparator.compare(value, node.value);
				if (compare == 0)
				{
					result = new Node<>(node.value, null, node.right);
				}
				else
				{
					if (compare < 0)
					{
						result = new Node<>(node.value, tail(node.left, value, comparator), node.right);
					}
					else
					{
						result = tail(node.right, value, comparator);
					}
				}
				result = balance(result);
			}
			return result;
		}

		public static <Type> void traverseOrderIn(Node<Type> node, Consumer<Type> consumer)
		{
			if (node != null)
			{
				traverseOrderIn(node.left, consumer);
				consumer.accept(node.value);
				traverseOrderIn(node.right, consumer);
			}
		}

		public final Type value;
		public final Node<Type> left;
		public final Node<Type> right;
		public final int size;
		private final int height;

		public Node(Type value, Node<Type> left, Node<Type> right)
		{
			this.value = value;
			this.left = left;
			this.right = right;
			this.size = 1 + size(left) + size(right);
			this.height = 1 + Math.max(height(left), height(right));
		}

		public Node<Type> rotateLeft()
		{
			Node<Type> left = new Node<>(this.value, this.left, this.right.left);
			return new Node<>(this.right.value, left, this.right.right);
		}

		public Node<Type> rotateRight()
		{
			Node<Type> right = new Node<>(this.value, this.left.right, this.right);
			return new Node<>(this.left.value, this.left.left, right);
		}
	}

	public static class SortedSetAVL<Type> implements SortedSet<Type>
	{
		public Comparator<? super Type> comparator;
		public Node<Type> root;

		private SortedSetAVL(Comparator<? super Type> comparator, Node<Type> root)
		{
			this.comparator = comparator;
			this.root = root;
		}

		public SortedSetAVL(Comparator<? super Type> comparator)
		{
			this(comparator, null);
		}

		public SortedSetAVL(Collection<? extends Type> collection, Comparator<? super Type> comparator)
		{
			this(comparator, null);
			this.addAll(collection);
		}

		public SortedSetAVL(SortedSetAVL<Type> sortedSetAVL)
		{
			this(sortedSetAVL.comparator, Node.clone(sortedSetAVL.root));
		}

		@Override
		public void clear()
		{
			this.root = null;
		}

		@Override
		public Comparator<? super Type> comparator()
		{
			return this.comparator;
		}

		public Type get(Type value)
		{
			Node<Type> node = Node.get(this.root, value, this.comparator);
			return node == null ? null : node.value;
		}

		@Override
		public SortedSetAVL<Type> subSet(Type valueStart, Type valueEnd)
		{
			return tailSet(valueStart).headSet(valueEnd);
		}

		@Override
		public SortedSetAVL<Type> headSet(Type valueEnd)
		{
			return new SortedSetAVL<>(this.comparator, Node.head(this.root, valueEnd, this.comparator));
		}

		@Override
		public SortedSetAVL<Type> tailSet(Type valueStart)
		{
			return new SortedSetAVL<>(this.comparator, Node.tail(this.root, valueStart, this.comparator));
		}

		@Override
		public Type first()
		{
			return Node.first(this.root).value;
		}

		@Override
		public Type last()
		{
			return Node.last(this.root).value;
		}

		@Override
		public int size()
		{
			return this.root == null ? 0 : this.root.size;
		}

		@Override
		public boolean isEmpty()
		{
			return this.root == null;
		}

		@Override
		public boolean contains(Object value)
		{
			return Node.get(this.root, (Type) value, this.comparator) != null;
		}

		@Override
		public Iterator<Type> iterator()
		{
			Stack<Node<Type>> path = new Stack<>();

			return new Iterator<Type>()
			{
				{
					push(SortedSetAVL.this.root);
				}

				public void push(Node<Type> node)
				{
					while (node != null)
					{
						path.push(node);
						node = node.left;
					}
				}

				@Override
				public boolean hasNext()
				{
					return !path.isEmpty();
				}

				@Override
				public Type next()
				{
					if (path.isEmpty())
					{
						throw new NoSuchElementException();
					}
					else
					{
						Node<Type> node = path.peek();
						Type result = node.value;
						if (node.right != null)
						{
							push(node.right);
						}
						else
						{
							do
							{
								node = path.pop();
							}
							while (!path.isEmpty() && path.peek().right == node);
						}
						return result;
					}
				}
			};
		}

		@Override
		public Object[] toArray()
		{
			List<Object> list = new ArrayList<>();
			Node.traverseOrderIn(this.root, list::add);
			return list.toArray();
		}

		@Override
		public <T> T[] toArray(T[] ts)
		{
			throw new UnsupportedOperationException();
		}

		@Override
		public boolean add(Type value)
		{
			int sizeBefore = size();
			this.root = Node.insert(this.root, value, this.comparator);
			return sizeBefore != size();
		}

		@Override
		public boolean remove(Object value)
		{
			int sizeBefore = size();
			this.root = Node.delete(this.root, (Type) value, this.comparator);
			return sizeBefore != size();
		}

		@Override
		public boolean containsAll(Collection<?> collection)
		{
			return collection.stream()
					.allMatch(this::contains);
		}

		@Override
		public boolean addAll(Collection<? extends Type> collection)
		{
			return collection.stream()
					.map(this::add)
					.reduce(true, (x, y) -> x | y);
		}

		@Override
		public boolean retainAll(Collection<?> collection)
		{
			SortedSetAVL<Type> set = new SortedSetAVL<>(this.comparator);
			collection.stream()
					.map(element -> (Type) element)
					.filter(this::contains)
					.forEach(set::add);
			boolean result = size() != set.size();
			this.root = set.root;
			return result;
		}

		@Override
		public boolean removeAll(Collection<?> collection)
		{
			return collection.stream()
					.map(this::remove)
					.reduce(true, (x, y) -> x | y);
		}

		@Override
		public String toString()
		{
			return "{" + B_special8.toString(this, ", ") + "}";
		}
	}

	public static class SortedMapAVL<TypeKey, TypeValue> implements SortedMap<TypeKey, TypeValue>
	{
		public final Comparator<? super TypeKey> comparator;
		public final SortedSetAVL<Entry<TypeKey, TypeValue>> entrySet;

		public SortedMapAVL(Comparator<? super TypeKey> comparator)
		{
			this(comparator, new SortedSetAVL<>((entry0, entry1) -> comparator.compare(entry0.getKey(), entry1.getKey())));
		}

		private SortedMapAVL(Comparator<? super TypeKey> comparator, SortedSetAVL<Entry<TypeKey, TypeValue>> entrySet)
		{
			this.comparator = comparator;
			this.entrySet = entrySet;
		}

		@Override
		public Comparator<? super TypeKey> comparator()
		{
			return this.comparator;
		}

		@Override
		public SortedMapAVL<TypeKey, TypeValue> subMap(TypeKey keyStart, TypeKey keyEnd)
		{
			return new SortedMapAVL<>(this.comparator, this.entrySet.subSet(new AbstractMap.SimpleEntry<>(keyStart, null), new AbstractMap.SimpleEntry<>(keyEnd, null)));
		}

		@Override
		public SortedMapAVL<TypeKey, TypeValue> headMap(TypeKey keyEnd)
		{
			return new SortedMapAVL<>(this.comparator, this.entrySet.headSet(new AbstractMap.SimpleEntry<>(keyEnd, null)));
		}

		@Override
		public SortedMapAVL<TypeKey, TypeValue> tailMap(TypeKey keyStart)
		{
			return new SortedMapAVL<>(this.comparator, this.entrySet.tailSet(new AbstractMap.SimpleEntry<>(keyStart, null)));
		}

		public Entry<TypeKey, TypeValue> firstEntry()
		{
			return this.entrySet.first();
		}

		@Override
		public TypeKey firstKey()
		{
			return firstEntry().getKey();
		}

		public Entry<TypeKey, TypeValue> lastEntry()
		{
			return this.entrySet.last();
		}

		@Override
		public TypeKey lastKey()
		{
			return lastEntry().getKey();
		}

		@Override
		public int size()
		{
			return this.entrySet().size();
		}

		@Override
		public boolean isEmpty()
		{
			return this.entrySet.isEmpty();
		}

		@Override
		public boolean containsKey(Object key)
		{
			return this.entrySet().contains(new AbstractMap.SimpleEntry<>((TypeKey) key, null));
		}

		@Override
		public boolean containsValue(Object value)
		{
			throw new UnsupportedOperationException();
		}

		@Override
		public TypeValue get(Object key)
		{
			Entry<TypeKey, TypeValue> entry = new AbstractMap.SimpleEntry<>((TypeKey) key, null);
			entry = this.entrySet.get(entry);
			return entry == null ? null : entry.getValue();
		}

		@Override
		public TypeValue put(TypeKey key, TypeValue value)
		{
			TypeValue result = get(key);
			Entry<TypeKey, TypeValue> entry = new AbstractMap.SimpleEntry<>(key, value);
			this.entrySet().add(entry);
			return result;
		}

		@Override
		public TypeValue remove(Object key)
		{
			TypeValue result = get(key);
			Entry<TypeKey, TypeValue> entry = new AbstractMap.SimpleEntry<>((TypeKey) key, null);
			this.entrySet.remove(entry);
			return result;
		}

		@Override
		public void putAll(Map<? extends TypeKey, ? extends TypeValue> map)
		{
			map.entrySet()
					.forEach(entry -> put(entry.getKey(), entry.getValue()));
		}

		@Override
		public void clear()
		{
			this.entrySet.clear();
		}

		@Override
		public Set<TypeKey> keySet()
		{
			throw new UnsupportedOperationException();
		}

		@Override
		public Collection<TypeValue> values()
		{
			return new Collection<TypeValue>()
			{
				@Override
				public int size()
				{
					return SortedMapAVL.this.entrySet.size();
				}

				@Override
				public boolean isEmpty()
				{
					return SortedMapAVL.this.entrySet.isEmpty();
				}

				@Override
				public boolean contains(Object value)
				{
					throw new UnsupportedOperationException();
				}

				@Override
				public Iterator<TypeValue> iterator()
				{
					return new Iterator<TypeValue>()
					{
						Iterator<Entry<TypeKey, TypeValue>> iterator = SortedMapAVL.this.entrySet.iterator();

						@Override
						public boolean hasNext()
						{
							return this.iterator.hasNext();
						}

						@Override
						public TypeValue next()
						{
							return this.iterator.next().getValue();
						}
					};
				}

				@Override
				public Object[] toArray()
				{
					throw new UnsupportedOperationException();
				}

				@Override
				public <T> T[] toArray(T[] ts)
				{
					throw new UnsupportedOperationException();
				}

				@Override
				public boolean add(TypeValue typeValue)
				{
					throw new UnsupportedOperationException();
				}

				@Override
				public boolean remove(Object o)
				{
					throw new UnsupportedOperationException();
				}

				@Override
				public boolean containsAll(Collection<?> collection)
				{
					throw new UnsupportedOperationException();
				}

				@Override
				public boolean addAll(Collection<? extends TypeValue> collection)
				{
					throw new UnsupportedOperationException();
				}

				@Override
				public boolean removeAll(Collection<?> collection)
				{
					throw new UnsupportedOperationException();
				}

				@Override
				public boolean retainAll(Collection<?> collection)
				{
					throw new UnsupportedOperationException();
				}

				@Override
				public void clear()
				{
					throw new UnsupportedOperationException();
				}
			};
		}

		@Override
		public SortedSetAVL<Entry<TypeKey, TypeValue>> entrySet()
		{
			return this.entrySet;
		}

		@Override
		public String toString()
		{
			return this.entrySet().toString();
		}
	}

	public static class FIFO<Type>
	{
		public SingleLinkedList<Type> start;
		public SingleLinkedList<Type> end;

		public FIFO()
		{
			this.start = null;
			this.end = null;
		}

		public boolean isEmpty()
		{
			return this.start == null;
		}

		public Type peek()
		{
			return this.start.element;
		}

		public Type pop()
		{
			Type result = this.start.element;
			this.start = this.start.next;
			return result;
		}

		public void push(Type element)
		{
			SingleLinkedList<Type> list = new SingleLinkedList<>(element, null);
			if (this.start == null)
			{
				this.start = list;
				this.end = list;
			}
			else
			{
				this.end.next = list;
				this.end = list;
			}
		}
	}

	public static class MapCount<Type> extends SortedMapAVL<Type, Long>
	{
		private int count;

		public MapCount(Comparator<? super Type> comparator)
		{
			super(comparator);
			this.count = 0;
		}

		public long add(Type key, Long delta)
		{
			long result;
			if (delta > 0)
			{
				Long value = get(key);
				if (value == null)
				{
					value = delta;
				}
				else
				{
					value += delta;
				}
				put(key, value);
				result = delta;
			}
			else
			{
				result = 0;
			}
			this.count += result;
			return result;
		}

		public int count()
		{
			return this.count;
		}

		public List<Type> flatten()
		{
			List<Type> result = new ArrayList<>();
			for (Entry<Type, Long> entry : entrySet())
			{
				for (long index = 0; index < entry.getValue(); index++)
				{
					result.add(entry.getKey());
				}
			}
			return result;
		}

		@Override
		public void putAll(Map<? extends Type, ? extends Long> map)
		{
			throw new UnsupportedOperationException();
		}

		@Override
		public Long remove(Object key)
		{
			Long result = super.remove(key);
			this.count -= result;
			return result;
		}

		public long remove(Type key, Long delta)
		{
			long result;
			if (delta > 0)
			{
				Long value = get(key) - delta;
				if (value <= 0)
				{
					result = delta + value;
					remove(key);
				}
				else
				{
					result = delta;
					put(key, value);
				}
			}
			else
			{
				result = 0;
			}
			this.count -= result;
			return result;
		}

		@Override
		public SortedMapAVL<Type, Long> subMap(Type keyStart, Type keyEnd)
		{
			throw new UnsupportedOperationException();
		}

		@Override
		public SortedMapAVL<Type, Long> headMap(Type keyEnd)
		{
			throw new UnsupportedOperationException();
		}

		@Override
		public SortedMapAVL<Type, Long> tailMap(Type keyStart)
		{
			throw new UnsupportedOperationException();
		}
	}

	public static class MapSet<TypeKey, TypeValue> extends SortedMapAVL<TypeKey, SortedSetAVL<TypeValue>> implements Iterable<TypeValue>
	{
		private Comparator<? super TypeValue> comparatorValue;

		public MapSet(Comparator<? super TypeKey> comparatorKey, Comparator<? super TypeValue> comparatorValue)
		{
			super(comparatorKey);
			this.comparatorValue = comparatorValue;
		}

		public MapSet(Comparator<? super TypeKey> comparatorKey, SortedSetAVL<Entry<TypeKey, SortedSetAVL<TypeValue>>> entrySet, Comparator<? super TypeValue> comparatorValue)
		{
			super(comparatorKey, entrySet);
			this.comparatorValue = comparatorValue;
		}

		public TypeValue firstValue()
		{
			TypeValue result;
			Entry<TypeKey, SortedSetAVL<TypeValue>> firstEntry = firstEntry();
			if (firstEntry == null)
			{
				result = null;
			}
			else
			{
				result = firstEntry.getValue().first();
			}
			return result;
		}

		public Iterator<TypeValue> iterator()
		{
			return new Iterator<TypeValue>()
			{
				Iterator<SortedSetAVL<TypeValue>> iteratorValues = values().iterator();
				Iterator<TypeValue> iteratorValue = null;

				@Override
				public boolean hasNext()
				{
					return iteratorValues.hasNext() || (iteratorValue != null && iteratorValue.hasNext());
				}

				@Override
				public TypeValue next()
				{
					if (iteratorValue == null || !iteratorValue.hasNext())
					{
						iteratorValue = iteratorValues.next().iterator();
					}
					return iteratorValue.next();
				}
			};
		}

		public TypeValue lastValue()
		{
			TypeValue result;
			Entry<TypeKey, SortedSetAVL<TypeValue>> lastEntry = lastEntry();
			if (lastEntry == null)
			{
				result = null;
			}
			else
			{
				result = lastEntry.getValue().last();
			}
			return result;
		}

		public boolean add(TypeKey key, TypeValue value)
		{
			SortedSetAVL<TypeValue> set = computeIfAbsent(key, k -> new SortedSetAVL<>(comparatorValue));
			return set.add(value);
		}

		public boolean removeSet(TypeKey key, TypeValue value)
		{
			boolean result;
			SortedSetAVL<TypeValue> set = get(key);
			if (set == null)
			{
				result = false;
			}
			else
			{
				result = set.remove(value);
				if (set.size() == 0)
				{
					remove(key);
				}
			}
			return result;
		}

		@Override
		public MapSet<TypeKey, TypeValue> headMap(TypeKey keyEnd)
		{
			return new MapSet<>(this.comparator, this.entrySet.headSet(new AbstractMap.SimpleEntry<>(keyEnd, null)), this.comparatorValue);
		}

		@Override
		public MapSet<TypeKey, TypeValue> tailMap(TypeKey keyStart)
		{
			return new MapSet<>(this.comparator, this.entrySet.tailSet(new AbstractMap.SimpleEntry<>(keyStart, null)), this.comparatorValue);
		}
	}

	static class IteratorBuffer<Type>
	{
		private Iterator<Type> iterator;
		private List<Type> list;

		public IteratorBuffer(Iterator<Type> iterator)
		{
			this.iterator = iterator;
			this.list = new ArrayList<Type>();
		}

		public Iterator<Type> iterator()
		{
			return new Iterator<Type>()
			{
				int index = 0;

				@Override
				public boolean hasNext()
				{
					return this.index < list.size() || iterator().hasNext();
				}

				@Override
				public Type next()
				{
					if (list.size() <= this.index)
					{
						list.add(iterator.next());
					}
					Type result = list.get(index);
					index += 1;
					return result;
				}
			};
		}
	}

	public static <Type> List<List<Type>> permutations(List<Type> list)
	{
		List<List<Type>> result = new ArrayList<>();
		result.add(new ArrayList<>());
		for (Type element : list)
		{
			List<List<Type>> permutations = result;
			result = new ArrayList<>();
			for (List<Type> permutation : permutations)
			{
				for (int index = 0; index <= permutation.size(); index++)
				{
					List<Type> permutationNew = new ArrayList<>(permutation);
					permutationNew.add(index, element);
					result.add(permutationNew);
				}
			}
		}
		return result;
	}

	public static List<List<Integer>> combinations(int n, int k)
	{
		List<List<Integer>> result = new ArrayList<>();
		if (k == 0)
		{
		}
		else
		{
			if (k == 1)
			{
				List<Integer> combination = new ArrayList<>();
				combination.add(n);
				result.add(combination);
			}
			else
			{
				for (int index = 0; index <= n; index++)
				{
					for (List<Integer> combination : combinations(n - index, k - 1))
					{
						combination.add(index);
						result.add(combination);
					}
				}
			}
		}
		return result;
	}

	public static <Type> int compare(Iterator<Type> iterator0, Iterator<Type> iterator1, Comparator<Type> comparator)
	{
		int result = 0;
		while (result == 0 && iterator0.hasNext() && iterator1.hasNext())
		{
			result = comparator.compare(iterator0.next(), iterator1.next());
		}
		if (result == 0)
		{
			if (iterator1.hasNext())
			{
				result = -1;
			}
			else
			{
				if (iterator0.hasNext())
				{
					result = 1;
				}
			}
		}
		return result;
	}

	public static <Type> int compare(Iterable<Type> iterable0, Iterable<Type> iterable1, Comparator<Type> comparator)
	{
		return compare(iterable0.iterator(), iterable1.iterator(), comparator);
	}

	private static String nextString() throws IOException
	{
		while ((stringTokenizer == null) || (!stringTokenizer.hasMoreTokens()))
		{
			stringTokenizer = new StringTokenizer(bufferedReader.readLine());
		}
		return stringTokenizer.nextToken();
	}

	private static String[] nextStrings(int n) throws IOException
	{
		String[] result = new String[n];
		{
			for (int index = 0; index < n; index++)
			{
				result[index] = nextString();
			}
		}
		return result;
	}

	public static int nextInt() throws IOException
	{
		return Integer.parseInt(nextString());
	}

	public static int[] nextInts(int n) throws IOException
	{
		int[] result = new int[n];
		{
			for (int index = 0; index < n; index++)
			{
				result[index] = nextInt();
			}
		}
		return result;
	}

	public static double nextDouble() throws IOException
	{
		return Double.parseDouble(nextString());
	}

	public static long nextLong() throws IOException
	{
		return Long.parseLong(nextString());
	}

	public static long[] nextLongs(int n) throws IOException
	{
		long[] result = new long[n];
		{
			for (int index = 0; index < n; index++)
			{
				result[index] = nextLong();
			}
		}
		return result;
	}

	public static String nextLine() throws IOException
	{
		return bufferedReader.readLine();
	}

	public static void close()
	{
		out.close();
	}

	public static int binarySearchMinimum(Function<Integer, Boolean> filter, int start, int end)
	{
		int result;
		if (start == end)
		{
			result = end;
		}
		else
		{
			int middle = start + (end - start) / 2;
			if (filter.apply(middle))
			{
				result = binarySearchMinimum(filter, start, middle);
			}
			else
			{
				result = binarySearchMinimum(filter, middle + 1, end);
			}
		}
		return result;
	}

	public static int binarySearchMaximum(Function<Integer, Boolean> filter, int start, int end)
	{
		return -binarySearchMinimum(x -> filter.apply(-x), -end, -start);
	}

	public static long divideCeil(long x, long y)
	{
		return (x + y - 1) / y;
	}

	public static Set<Long> divisors(long n)
	{
		SortedSetAVL<Long> result = new SortedSetAVL<>(Comparator.naturalOrder());
		result.add(1L);
		for (Long factor : factors(n))
		{
			SortedSetAVL<Long> divisors = new SortedSetAVL<>(result);
			for (Long divisor : result)
			{
				divisors.add(divisor * factor);
			}
			result = divisors;
		}
		return result;
	}

	public static long faculty(int n)
	{
		long result = 1;
		for (int index = 2; index <= n; index++)
		{
			result *= index;
		}
		return result;
	}

	public static LinkedList<Long> factors(long n)
	{
		LinkedList<Long> result = new LinkedList<>();
		Iterator<Long> primes = ITERATOR_BUFFER_PRIME.iterator();
		Long prime;
		while (n > 1 && (prime = primes.next()) * prime <= n)
		{
			while (n % prime == 0)
			{
				result.add(prime);
				n /= prime;
			}
		}
		if (n > 1)
		{
			result.add(n);
		}
		return result;
	}

	public static long gcd(long a, long b)
	{
		while (a != 0 && b != 0)
		{
			if (a > b)
			{
				a %= b;
			}
			else
			{
				b %= a;
			}
		}
		return a + b;
	}

	public static long[] generatePOWER2()
	{
		long[] result = new long[63];
		for (int x = 0; x < result.length; x++)
		{
			result[x] = 1L << x;
		}
		return result;
	}

	public static boolean isPrime(long x)
	{
		boolean result = x > 1;
		Iterator<Long> iterator = ITERATOR_BUFFER_PRIME.iterator();
		Long prime;
		while ((prime = iterator.next()) * prime <= x)
		{
			result &= x % prime > 0;
		}
		return result;
	}

	public static long knapsack(List<Tuple3<Long, Integer, Integer>> itemsValueWeightCount, int weightMaximum)
	{
		long[] valuesMaximum = new long[weightMaximum + 1];
		for (Tuple3<Long, Integer, Integer> itemValueWeightCount : itemsValueWeightCount)
		{
			long itemValue = itemValueWeightCount.v0;
			int itemWeight = itemValueWeightCount.v1;
			int itemCount = itemValueWeightCount.v2;
			for (int weight = weightMaximum; 0 <= weight; weight--)
			{
				for (int index = 1; index <= itemCount && 0 <= weight - index * itemWeight; index++)
				{
					valuesMaximum[weight] = Math.max(valuesMaximum[weight], valuesMaximum[weight - index * itemWeight] + index * itemValue);
				}
			}
		}
		long result = 0;
		for (long valueMaximum : valuesMaximum)
		{
			result = Math.max(result, valueMaximum);
		}
		return result;
	}

	public static boolean knapsackPossible(List<Tuple2<Integer, Integer>> itemsWeightCount, int weightMaximum)
	{
		boolean[] weightPossible = new boolean[weightMaximum + 1];
		weightPossible[0] = true;
		int weightLargest = 0;
		for (Tuple2<Integer, Integer> itemWeightCount : itemsWeightCount)
		{
			int itemWeight = itemWeightCount.v0;
			int itemCount = itemWeightCount.v1;
			for (int weightStart = 0; weightStart < itemWeight; weightStart++)
			{
				int count = 0;
				for (int weight = weightStart; weight <= weightMaximum && (0 < count || weight <= weightLargest); weight += itemWeight)
				{
					if (weightPossible[weight])
					{
						count = itemCount;
					}
					else
					{
						if (0 < count)
						{
							weightPossible[weight] = true;
							weightLargest = weight;
							count -= 1;
						}
					}
				}
			}
		}
		return weightPossible[weightMaximum];
	}

	public static long lcm(int a, int b)
	{
		return a * b / gcd(a, b);
	}

	public static <T> List<T> permutation(long p, List<T> x)
	{
		List<T> copy = new ArrayList<>();
		for (int index = 0; index < x.size(); index++)
		{
			copy.add(x.get(index));
		}
		List<T> result = new ArrayList<>();
		for (int indexTo = 0; indexTo < x.size(); indexTo++)
		{
			int indexFrom = (int) p % copy.size();
			p = p / copy.size();
			result.add(copy.remove(indexFrom));
		}
		return result;
	}

	public static <Type> String toString(Iterator<Type> iterator, String separator)
	{
		StringBuilder stringBuilder = new StringBuilder();
		if (iterator.hasNext())
		{
			stringBuilder.append(iterator.next());
		}
		while (iterator.hasNext())
		{
			stringBuilder.append(separator);
			stringBuilder.append(iterator.next());
		}
		return stringBuilder.toString();
	}

	public static <Type> String toString(Iterator<Type> iterator)
	{
		return toString(iterator, " ");
	}

	public static <Type> String toString(Iterable<Type> iterable, String separator)
	{
		return toString(iterable.iterator(), separator);
	}

	public static <Type> String toString(Iterable<Type> iterable)
	{
		return toString(iterable, " ");
	}

	public static Stream<BigInteger> streamFibonacci()
	{
		return Stream.generate(new Supplier<BigInteger>()
		{
			private BigInteger n0 = BigInteger.ZERO;
			private BigInteger n1 = BigInteger.ONE;

			@Override
			public BigInteger get()
			{
				BigInteger result = n0;
				n0 = n1;
				n1 = result.add(n0);
				return result;
			}
		});
	}

	public static Stream<Long> streamPrime(int sieveSize)
	{
		return Stream.generate(new Supplier<Long>()
		{
			private boolean[] isPrime = new boolean[sieveSize];
			private long sieveOffset = 2;
			private List<Long> primes = new ArrayList<>();
			private int index = 0;

			public void filter(long prime, boolean[] result)
			{
				if (prime * prime < this.sieveOffset + sieveSize)
				{
					long remainingStart = this.sieveOffset % prime;
					long start = remainingStart == 0 ? 0 : prime - remainingStart;
					for (long index = start; index < sieveSize; index += prime)
					{
						result[(int) index] = false;
					}
				}
			}

			public void generatePrimes()
			{
				Arrays.fill(this.isPrime, true);
				this.primes.forEach(prime -> filter(prime, isPrime));
				for (int index = 0; index < sieveSize; index++)
				{
					if (isPrime[index])
					{
						this.primes.add(this.sieveOffset + index);
						filter(this.sieveOffset + index, isPrime);
					}
				}
				this.sieveOffset += sieveSize;
			}

			@Override
			public Long get()
			{
				while (this.primes.size() <= this.index)
				{
					generatePrimes();
				}
				Long result = this.primes.get(this.index);
				this.index += 1;
				return result;
			}
		});
	}

	public static long totient(long n)
	{
		Set<Long> factors = new SortedSetAVL<>(factors(n), Comparator.naturalOrder());
		long result = n;
		for (long p : factors)
		{
			result -= result / p;
		}
		return result;
	}

	public static void main(String[] args)
	{
		try
		{
			solve();
		} catch (IOException exception)
		{
			exception.printStackTrace();
		}
		close();
	}

	public static int solveSmallestSubtasks(int n, int k, int M, int[] ts)
	{
		int result = 0;
		for (int t : ts)
		{
			int solve = Math.min(n, M / t);
			result += solve;
			M -= solve * t;
		}
		return result;
	}

	public static int solve(int n, int k, int M, int[] ts, int sum)
	{
		int result = solveSmallestSubtasks(n, k, M, ts);
		if (sum <= M)
		{
			result = Math.max(result, k + 1 + solve(n - 1, k, M - sum, ts, sum));
		}
		return result;
	}

	public static void solve() throws IOException
	{
		int n = nextInt();
		int k = nextInt();
		int M = nextInt();
		int[] ts = nextInts(k);
		Arrays.sort(ts);
		int sum = 0;
		for (int t : ts)
		{
			sum += t;
		}
		out.println(solve(n, k, M, ts, sum));
	}
}


import java.util.Scanner;

public class Aa {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int k = s.nextInt();
		long m = s.nextLong();
		int[] cost = new int[k];
		for (int i = 0; i < k; i++) {
			cost[i] = s.nextInt();
		}
		quickSort(cost, 0, cost.length - 1);
		System.out.println(computePoint(cost, m, 0, n - 1));
	}

	private static int computePoint(int[] cost, long m, int levelNum, int lastNum) {
		int[] increasPoint = new int[Math.max(cost.length,lastNum) + 1];
		if (levelNum < cost.length) {
			for (int i = 0; i <= lastNum; i++) {
				if (m >= cost[levelNum]) {
					m -= cost[levelNum];
					if (levelNum == (cost.length - 1)) {
						increasPoint[increasPoint.length - 1] =  2*(i + 1);
					} else {
						increasPoint[i] = increasPoint[i] + computePoint(cost, m, levelNum + 1, i) + i + 1;
					}
				} else {
					break;
				}

			}
		}
		return findMax(increasPoint);
	}

	private static int findMax(int[] increasPoint) {
		int length = increasPoint.length;
		int max = 0;
		if(length >= 1){
			max = increasPoint[0];
			for (int i = 0; i < length; i++) {
				if(max < increasPoint[i]){
					max = increasPoint[i];
				}
			}
		}else{

		}
		return max;
	}

	public static void quickSort(int[] arr, int low, int high) {
		if (arr == null || arr.length == 0)
			return;

		if (low >= high)
			return;

		// pick the pivot
		int middle = low + (high - low) / 2;
		int pivot = arr[middle];

		// make left < pivot and right > pivot
		int i = low, j = high;
		while (i <= j) {
			while (arr[i] < pivot) {
				i++;
			}

			while (arr[j] > pivot) {
				j--;
			}

			if (i <= j) {
				int temp = arr[i];
				arr[i] = arr[j];
				arr[j] = temp;
				i++;
				j--;
			}
		}

		// recursively sort two sub parts
		if (low < j)
			quickSort(arr, low, j);

		if (high > i)
			quickSort(arr, i, high);
	}
}


import java.util.*;
import java.io.*;
public class B846 {
	public static void main(String args[])throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		int k = Integer.parseInt(st.nextToken());
		long M = Integer.parseInt(st.nextToken());
		int a[] = new int[k];
		long sum =0, result =0;
		st = new StringTokenizer(br.readLine());
		for(int i=0; i<k; i++) {
			a[i] = Integer.parseInt(st.nextToken());
			sum+=a[i];
		}
		long result1=0, M1=M;
		Arrays.sort(a);
		for(int i=0; i<k;i++) {
			long temp = n*a[i];
			if(M1 >= a[i]) {
				if(M1 <= temp) {
					result1 += M1/a[i];
					M1-=a[i]*(M1/a[i]);
				}
				else {
					result1 += n;
					M1-=a[i]*n;
				}
			}
		}
		long tasks = M/sum;
		result = tasks * (k+1);
		M%=sum;
		for(int i=0; i<k; i++) {
			long temp = (n-tasks)*a[i];
			if(M >= a[i] && M <= temp) {
				result += M/a[i];
				M-=a[i]*(M/a[i]);
			}
			if(M >= a[i] && M > temp) {
				result += n-tasks;
				M-=a[i]*n-tasks;
			}
		}
		out.println(Math.max(result1, Math.min(result, n*(k+1))));
		out.flush();
	}
}


import java.util.Scanner;

public class CF846BMathShow {

    public static void main(String[] args) {
        File input = new File("codeforce\\CF846Binput.txt");
        Scanner in = null;
        try {
            in = new Scanner(input);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }

//        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        int k = in.nextInt();
        int m = in.nextInt();
        in.nextLine();
        int[] subtaskTimes = new int[k];
        for (int i = 0; i < k; i++) {
            subtaskTimes[i] = in.nextInt();
        }

        int score = smallestSubtaskUp(n, k, m, subtaskTimes);

        System.out.println(score);

    }

    private static int smallestSubtaskUp(int n, int k, int m, int[] subtaskTimes) {
        int timeUsed = 0;
        int score = 0;

        outerloop:
        for (int subtask = 0; subtask < k; subtask++) {

            for (int task = 0; task < n; task++) {
                timeUsed += subtaskTimes[subtask];
                if (timeUsed > m) {
                    break outerloop;
                }
                score++;
                if (subtask == k-1)
                    score++;
            }
        }

        return score;
    }
}


import java.util.*;
public class Mai
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		char a[]=new char[26];
		int iii=0;
		for(char al='A';al<='Z';al++){
		    a[iii]=al;
		    iii++;
		}
		int len=s.length();
		boolean f=true;
		int pos1=0,pos2=0,pos3=0;
		for(int i=0;i<len-2;i++){
		    int j=0,jj=0;
		    while(s.charAt(i)!=a[j]){
		        j++;
		    }
		    pos1=j
		   while(s.charAt(i+1)!=a[jj]){
		        jj++;
		    }
		    pos2=jj;
		    pos3=pos1+pos2;
		    if(a[pos3]!=s.charAt(i+2)){
		        f=false;
		    }
		}
		if(f){
		    System.out.println("YES");
		}
		else{
		    System.out.println("NO");
		}
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MahmoudJobeel
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        SagheerScanner in = new SagheerScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CFibonacciWords solver = new CFibonacciWords();
        solver.solve(1, in, out);
        out.close();
    }

    static class CFibonacciWords {
        public void solve(int testNumber, SagheerScanner sc, PrintWriter pw) throws IOException {
            char[] ch = sc.next().toCharArray();
            if (ch.length < 3) pw.println("YES");
            else {
                boolean f = true;
                for (int i = 2; i < ch.length; i++) {
                    f &= (((ch[i - 1] - 'A') + (ch[i - 2] - 'A')) % 26 + 'A' - ch[i] == 0);
                }
                pw.println(f ? "YES" : "NO");
            }
        }

    }

    static class SagheerScanner {
        public StringTokenizer st;
        public BufferedReader br;

        public SagheerScanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

    }
}


import java.util.*;
public class Main
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		char a[]=new char[26];
		int i=0;
		for(char al='A';al<='Z';al++){
		    a[i]=al;
		    i++;
		}
		int len=s.length();
		boolean f=true;
		int pos1=0,pos2=0,pos3=0;
		for(int i=0;i<len-2;i++){
		    int j=0,jj=0;
		    if(s.charAt(i)==a[j]){
		        pos1=j;
		    }
		    if(s.charAt(i+1)==a[jj]){
		        pos2=jj;
		    }
		    pos3=pos1+pos2;
		    if(a[pos3]!=s.charAt(i+2)){
		        f=false;
		        break;
		    }
		}
		if(f){
		    System.out.println("YES");
		}
		else{
		    System.out.println("NO");
		}
	}

}


import java.util.*;
public class Ma
{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		String s=sc.next();
		char a[]=new char[26];
		int i=0;
		for(char al='A';al<='Z';al++){
		    a[i]=al;
		    i++;
		}
		int len=s.length();
		boolean f=true;
		int pos1=0,pos2=0,pos3=0;
		for(int i=0;i<len-2;i++){
		    int j=0,jj=0;
		    if(s.charAt(i)==a[j]){
		        pos1=j;
		    }
		    if(s.charAt(i+1)==a[jj]){
		        pos2=jj;
		    }
		    pos3=pos1+pos2;
		    if(a[pos3]!=s.charAt(i+2)){
		        f=false;
		    }
		}
		if(f){
		    System.out.println("YES");
		}
		else{
		    System.out.println("NO");
		}
	}

}


import java.util.*;
public class TaskB
{
    public static void main(String[] args)
    {
        try
        {
            Scanner sc = new Scanner(System.in);
            int n = sc.nextInt();
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++)
            {
                int t = sc.nextInt();
                String dir = sc.nextInt();
                if(dir.equals("South"))
                {
                    y += t;
                }
                else if(dir.equals("East"))
                {
                    x += t;
                }
                else if(dir.equals("North"))
                {
                    y -= t;
                }
                else if(dir.equals("West"))
                {
                    x -= t;
                }
            }
            y = Math.abs(y);
            if(y == 0)
            {
                System.out.println("YES");
                return;
            }
            else
            {
                System.out.println("NO");
            }
        }
        catch(Exception excp)
        {
            //...
        }
    }
}


public class Solution {
    public static void main(String args[] ) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String l = br.readLine();
        int n = Integer.parseInt(l);
        int last=0,t;

        for(t=0;t<n;t++){
        	String[] str = br.readLine().split(" ");
        	int dis = Integer.parseInt(str[0]);

        	if((last==0 && !str[1].equals("South")) || (last==20000 && !str[1].equals("North"))){
        		break;
        	}
        	if(str[1].equals("South"))		last += dis;
        	else if(str[1].equals("North"))		last -= dis;
        }
        if(t==n && last==0)	System.out.println("YES");
        else	System.out.println("NO");
    }
}


package com.turtle.bone;

//import java.util.Scanner;

public class MY750 {

	public static Scanner cin = new Scanner(System.in);

	public String test(int n,int[] t,String[] dir){
		int south=0;
		int north=0;
		for(int i=0;i<n;i++){
			if(dir[i].equals("South")){
				south+=t[i];
			}else if(dir[i].equals("North")){
				north+=t[i];
			}
		}
		if(north!=south){
			return "NO";
		}else{
			return "YES";
		}

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		while(cin.hasNext()){
			int n=cin.nextInt();
			int[] t=new int[n];
			String[] dir=new String[n];
			for(int i=0;i<n;i++){
				t[i]=cin.nextInt();
				dir[i]=cin.next();
			}

			String res=new MY750().test(n, t,dir);
			System.out.println(res);

		}
	}

}


import java.io.*;
import java.util.*;
/*
 * CodeForces New Year and Hurry
 * @derrick20
 */

public class B {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        N = sc.nextInt();
        int last = 0; // Represents the last pole visited. 0 is N, 1 if S
        int total = 0;

        for (int i = 0; i < N; i++) {
            int dist = sc.nextInt();
            String dir = sc.next();
            switch(dir) {
                case "North":
                    if (i == 0) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    total -= dist;
                    break;
                case "South":
                    total += dist;
                    break;
                case "East":
                case "West":
                    if (total % 20000 == 0) {
                        System.out.println("NO");
                        System.exit(0);
                    }
                    break;
            }

            // Went too far
            if (total > 20000 || total < 0) {
                System.out.println("NO");
                System.exit(0);
            }

            // If we reach a pole (after the first movement, then update last)
            if (total % 20000 == 0) {
                last = 1 - last; // change state
            }

        }
        if (total != 0) {
            System.out.println("NO");
        }
        else {
            // If passed everything, then yes!
            System.out.println("YES");
        }
    }

    static class Scanner {
        BufferedReader br;
        StringTokenizer st;

        Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        Scanner(FileReader s) {
            br = new BufferedReader(s);
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }
    }
}


import java.io.*;
import java.util.*;

public class a{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = scan.nextInt()%6;
        int num2 = scan.nextInt();
        int[] array = new int[3];

        for (int i = 0; i < 3; ++i) array[i] = i;
        for (int i = 1; i <= n; ++i) {
            int temp = array[1];
            array[1] = array[2-2*(i)];
            array[2-2*i] = temp;
        }
        System.out.println(array[num2]);

    }
}


import java.util.*;
public class shell
{
    public static void main(String args[])
    {
        bufferedReader br=new bufferedReader(new inputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
        int x=Integer.parseInt(br.readLine());
        if(x<0||x>2)
        System.exit(0);
        int arr[]=new int[3];
        arr[x]=1;
        int temp=0;
        while(n!=0)
        {
            if(n%2==0)
            {
               temp=arr[1];
               arr[1]=arr[2];
               arr[2]=temp;
            }
            else
            {
                temp=arr[1];
               arr[1]=arr[0];
               arr[0]=temp;
            }
            n=n-1;
        }
        for(int i=0;i<3;i++)
        {
            if(arr[i]==1)
            System.out.println(i);
        }
    }
}


public class Test {

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int current = sc.nextInt();

        if (n % 3 == 0) {
            System.out.println(current);
        } else {
            int rem = n%3;
            if (current - rem < 0) {
                System.out.println(3+(current-rem));
            } else {
                System.out.println(current-rem);
            }
        }
    }
}


import java.util.*;
public class shell
{
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int x=sc.nextInt();
        int arr[]=new int[3];
        arr[x]=1;
        int temp=0;
        while(n!=0)
        {
            if(n%2==0)
            {
               temp=a[1];
               a[1]=a[2];
               a[2]=temp;
            }
            else
            {
                temp=a[1];
               a[1]=a[0];
               a[0]=temp;
            }
            n=n-1;
        }
        for(int i=0;i<3;i++)
        {
            if(arr[i]==1)
            System.out.println(i);
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    private void solve() {
        int w = nextInt();
        int h = nextInt();
        int k = nextInt();
        int kol=0;
        for (int i = 0; i < k; i++) {
            kol += (w*2+h*2)-4;
            w-=4;
            h-=4
        }
        out.print();
    }
    public static void main(String[] args) {
        new Main().run();
    }

    BufferedReader br;
    StringTokenizer st;
    PrintWriter out;

    private void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
            //br = new BufferedReader(new FileReader("birthday.in"));
            //out = new PrintWriter(new FileWriter("birthday.out"));
            solve();
            br.close();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private int nextInt() {
        return Integer.parseInt(next());
    }

    private String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
                return "END_OF_FILE";
            }
        }
        return st.nextToken();
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

import java.util.*;

public class Main{
    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        args = br.readLine().split(" ");
        int w = Integer.parseInt(args[0]), h = Integer.parseInt(args[1]), k = Integer.parseInt(args[2]);

        System.out.println(numGLidedCells(w, h, k));
    }

    public static int numGlidedCells(int w, int h, int k) {
        int count = 0;

        for (int i = 1; i <= k; i++) {
            int wi = w - 4 * (i-1), hi = h - 4 * (i-1);
            count += 2 * (wi) + 2 * (hi - 2);
        }

        return count;
    }

}


import java.util.*;
public class Main{
public static void main(String args[]){
Scanner s=new Scanner(System.in);
int n = s.nextInt();
int m = s.nextInt();
int k = s.nextInt();
int ans = 0;
while(n>0 && m>0){
ans+=n*2+m*2-4;
n-=4;
m-=4;
}
System.out.println(ans);
}


import java.util.*;

public class Sabado {

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int w = in.nextInt();
        int h = in.nextInt();
        int k = in.nextInt();
        System.out.println((2*k)*((w+h)-4(*k+2));
    }
}


import java.util.Scanner;

public class lol {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m=sc.nextInt();
        int h[] = new int[m];
                 int l[] =new int[m];
        int g = 0,u=0,t,o=0,k,p=0;
        for (int i = 0; i < m*2; i++) {
           t=sc.nextInt();

            if(i%2!=0){
                if(i!=0){
                l[u]=t;
            u++;

            }
            }else{
            h[p]=t;
            p++;
            }
            }

        int y=0;

        for (int i = 0; i < l.length; i++) {

            for (int v = 0; v < l.length-1; v++) {
            if(l[y]<l[v+1]){
            y=v+1;
            }
            }

            for (int j = 0; j < h[y]&& n>0; j++) {
                o+=l[y];
                n--;
            }

           l[y]=0;

            if(n==0){
            i=900;
            }

        }


import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {

	public static void main(String [] args){

       Scanner in = new Scanner(System.in);

       int n = in.nextInt();
       int m = in.nextInt();

       int [] a = new int[m];
       int [] b = new int [m];
       int [] a1 = new int [m];
       int [] b1 = new int [m];

       for(int i=0 ; i<m ; i++){

    	   a[i] = in.nextInt();
    	   b[i] = in.nextInt();
       } //end for

       int index = 0 , max = 0;
       for(int i=0 ; i<m ; i++){
    	    max = b[i];
    	   for(int j=0 ; j<m ; j++)
    	   if(b[j] >= max){
    		   max = b[j];
    		   index = j;
    	   }//end if
    	   a1[i] = a[index];
		   b1[i] = b[index];
		   b[index] = 0;
		   max = 0;
       }//end for

      /* for(int i=0 ; i<m ; i++)
    	   System.out.print(a1[i] + " " + b1[i]+"\n");*/

       int max=0;
       for(int i=0 ; i<m ; i++){

    	   if(a1[i] >= n){
    		   max += n * b1[i];
    		   break;
    	   }//end if
    	   else{
    		   max += a1[i] * b1[i];
    		   n -= a1[i];
    	   } //end else
       }//end for

       System.out.println(max);
	}
}


import java.util.Scanner;
import java.util.Arrays;
public class main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
                          int max = sc.nextInt();
                  int c=0;
                  Pair<Integer,Integer> p[] = new Pair[sc.nextInt()];
             for(int i =0;i<p.length;i++)
                 p[i] = new Pair<>(sc.nextInt(),sc.nextInt());
             Comparator<Pair<Integer,Integer>> x  = (Pair<Integer,Integer> p1,Pair<Integer,Integer> p2)->{
                if(p1.getValue() < p2.getValue()) return 1;
                else if(p1.getValue() > p2.getValue()) return -1;
                else if(p1.getKey() > p2.getKey()) return -1;
                else if(p1.getKey() < p2.getKey()) return 1;
                else return 0;
    };
            Arrays.sort(p,x);
            for(int i=0;i<p.length && max>0;i++){
                if(p[i].getKey()<=max)
                 c+=p[i].getValue()*p[i].getKey();
                else c+=max*p[i].getValue();
                max-=p[i].getKey();
            }
                  System.out.println(c);
    }
    static class Pair<K,V>{
        K k;
        V v;
        public Pair(K k,V v) {this.k=k;this.v=v;}
        public V getValue() {return v;}
        public K getKey()  {return k;}
        @Override
        public String toString(){
            return k+" "+v;
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }

    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private final DataInputStream din;
        private final byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }

    static long MOD = (long) (1e9 + 7);

    static long powerLL(long x, long n)
    {
        long result = 1;
        while (n > 0)
        {
            if (n % 2 == 1)
            {
                result = result * x % MOD;
            }
            n = n / 2;
            x = x * x % MOD;
        }
        return result;
    }

    static long powerStrings(String sa, String sb)
    {
        long a = 0, b = 0;

        for (int i = 0; i < sa.length(); i++)
        {
            a = (a * 10 + (sa.charAt(i) - '0')) %
                    MOD;
        }

        for (int i = 0; i < sb.length(); i++)
        {
            b = (b * 10 + (sb.charAt(i) - '0')) %
                    (MOD - 1);
        }

        return powerLL(a, b);
    }

    static long gcd(long a, long b)
    {
        if (a==0) return b;
        else return gcd(b%a,a);
    }

    static long lcm(long a, long b)
    {
        return (a*b)/gcd(a,b);
    }

    static int lower_bound(List<Integer> list, int k)
    {
        int s = 0;
        int e = list.size();

        while (s!=e)
        {
            int mid = (s+e)>>1;

            if (list.get(mid)<k) s = mid+1;
            else e = mid;
        }

        if (s == list.size()) return -1;
        return s;
    }

    static int upper_bound(List<Integer> list, int k)
    {
        int s = 0;
        int e = list.size();

        while (s!=e)
        {
            int mid = (s+e)>>1;

            if (list.get(mid)<=k) s = mid+1;
            else e = mid;
        }

        if (s == list.size()) return -1;
        return s;
    }

    static void addEdge(ArrayList<ArrayList<Integer>>graph, int edge1, int edge2)
    {
        graph.get(edge1).add(edge2);
        graph.get(edge2).add(edge1);
    }

    static class Pair<X,Y>
    {
        public final X first;
        public final Y second;

        Pair(X first, Y second)
        {
            this.first = first;
            this.second = second;
        }

        public static <X,Y> Pair <X,Y> of (X a, Y b)
        {
            return new Pair<>(a,b);
        }

        public String toString()
        {
            return "("+first+","+second+")";
        }
    }

    static class Compare
    {
        static void compare(List<Pair<Integer, Integer>> pairs, int m)
        {
            pairs.sort(new Comparator<Pair<Integer, Integer>>() {
                @Override
                public int compare(Pair<Integer, Integer> p1, Pair<Integer, Integer> p2) {
                    return p1.second - p2.second;
                }
            });
        }
    }

    public static void main(String[] args) throws java.lang.Exception
    {
        try
        {
            //FastReader fr = new FastReader();
            Reader fr = new Reader();

            try(OutputStream out = new BufferedOutputStream(System.out))
           // try(BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)))
            {
                int n = fr.nextInt();
                String s = fr.nextLine();

                String s1 = "";

                if ((n&1) == 1)
                {
                    for (int i=0;i<n;i++)
                    {
                        char c = s.charAt(i);

                        if ((i&1) == 0) s1=c+s1;
                        else s1+=c;
                    }
                }
                else
                {
                    for (int i=0;i<n;i++)
                    {
                        char c = s.charAt(i);

                        if ((i&1) == 1) s1=c+s1;
                        else s1+=c;
                    }
                }

                s = "";

                for (int i=0;i<s1.length();i++) s+=s1.charAt(n-1-i);

                out.write((s).getBytes());

                out.flush();
            }

        }

        catch(Exception e){}
        finally{}
    }
}

//(()) () (()((()()()())))


import java.util.scanner;
public class Problem734B{
    public class void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int twodigitcount=sc.nextInt();
        int threedigitcount=sc.nextInt();
        int fivedigitcount=sc.nextInt();
        int sixdigitcount=sc.nextInt();
        long sum=0;
        while(twodigitcount>=1)
        {
            if(fivedigitcount>=1 && sixdigitcount>=1)
            {
                sum=sum+256;
                twodigitcount--;
                fivedigitcount--;
                sixdigitcount--;
            }
            else if(twodigitcount>=1 && threedigitcount>=1)
            {
                twodigitcount--;
                threedigitcount--;
            }
            else
            {
                break;
            }
        }
        System.out.println(sum);

        }
    }
}


import java.util.*;
public class A{
    public static void main(String wsudhvgb[]){
        Scanner s=new Scanner(System.in);
        int a=s.nextInt();
        int b=s.nextInt();
        int c=s.nextInt();
        int d=s.nextInt();
        int s=0;
        c=Math.min(a,c,d);
        s+=c*256;
        a-=c;
        b=Math.min(a,b);
        s+=b*32;
        System.out.println(s);
    }
}


import java.util.*;
public class java
{
    public static void main(String args[])
    {
        Scanner in=new Scanner(System.in);
        long n2,n3,n5,n6,i,s=0,a;
        n2=in.nextLong();
        n3=in.nextLong();
        n5=in.nextLong();
        n6=in.nextLong();
        while(i!=0)
        {
            if(n2==0 || n5==0 || n6==0)
            {
                i=0;
                break;
            }
            n2=n2-1;
            n5=n5-1;
            n6=n6-1;
            s=s+256;
        }
        while(a!=0)
        {
            if(n2==0 || n3==0)
            {
                a=0;
                break;
            }
            n3=n3-1;
            n2=n2-1;
            s=s+32;
        }
        System.out.println(s);
    }
}


import java.util.*
public class main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in)
        int k2,k3,k5,k6;
        k2= scan.nextInt();
        k3= scan.nextInt();
        k3= scan.nextInt();
        k6= scan.nextInt();
        int u =Math.min(k2,k5,k6);
        int k;
        k=u*256;
        k2=k2-u;
        k5=k3-u;
        k6=k6-u;
        u=Math.min(k2,k3);
        k=k+u*32;
        System.out.println(k);
    }
}


import java.io.IOException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        boolean[][] b = new boolean[3][3];
        for (int i = 0; i < b.length; i++) {
            String str = in.nextLine();
            for (int j = 0; j < str.length(); j++) {
                if (str.charAt(j) == 'X') {
                    numberOfX++;
                    b[i][j] = true;
                }
            }
        }
        boolean c = true;
        search:
        for (int i = 0; i < b.length; i++) {
            for (int j = 0; j < b[i].length; j++) {
                if (b[i][j]) {
                    if (!b[2 - i][2 - j]) {
                        c = false;
                        break search;
                    }
                }
            }
        }
        String output = (c) ? "YES" : "NO";
        System.out.println(output);
    }
}


import java.util.*;
public class Solution{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int[][] arr = new int[3][3];
        for(int i=0;i<3;i++)
        {

                arr[i] = sc.next().toCharArray();

        }
        if(arr[0][0] == arr[2][2] && arr[0][1] == arr[2][1] && arr[0][2] == arr[2][0] && arr[1][0] == arr[2][1])
        {
            System.out.println("YES");
        }
        else
        {
            System.out.println("NO");
        }
    }
}


import java.util.*;
public class Main
{
    public static void main (String[] args)
    {
        Scanner a=new Scanner(System.in);
        char[][] b=new char[3][3];
        while(a.hasNextLine())
        {
            for(int i=0;i<3;i++)
            {
                b[i]=a.nextLine().toCharArray();
                if(test(lock))
                {
                    System.out.println("YES");
                }
                else{
                    System.out.println("NO");
                }
            }
        }
    }
    static boolean test(char[][] a)
    {
        return ()&&()&&()&&()
    }
}


import java.util.*;
public class Main
{
    public static void main (String[] args)
    {
        Scanner a=new Scanner(System.in);
        char[][] b=new char[3][3];
        while(a.hasNextLine())
        {
            for(int i=0;i<3;i++)
            {
                b[i]=a.nextLine().toCharArray();
                if(isyes(lock))
                {
                    System.out.println("YES");
                }
                else{
                    System.out.println("NO");
                }
            }
        }
    }
     static boolean isyes(char[][] lock)
    {
        return (lock[0][0]==lock[2][2]) && (lock[0][1]==lock[2][1]) && (lock[0][2]==lock[2][0]) && (lock[1][0]==lock[1][2]);
    }
}


import java.util.Scanner;

public class LadderB {

	static Scanner scn = new Scanner(System.in);

	public static void main(String[] args) {
	    magicSquare()
	}

public static void magicSquare(){
		int[][] arr = new int[3][3];

		for(int i = 0; i<3;i++){
			for(int j = 0; j<3;j++)
			arr[i][j] = scn.nextInt();
		}

		int zero = 0, one = 0, two = 0;

		for(int i = 0; i<3;i++){
			for(int j = 0; j<3;j++){
				if(j == 0){
					zero+=arr[i][j];
				} else if(j == 1){
					one+=arr[i][j];
				}else{
					two+=arr[i][j];
				}
			}
		}

		arr[0][0] = (two+one-zero)/2;
		arr[1][1] = (two+zero-one)/2;
		arr[2][2] = (one+zero-two)/2;

		for(int i = 0 ;i<3;i++){
			for(int j = 0; j<3;j++){
				System.out.print(arr[i][j]+" ");
			}
			System.out.println();
		}
	}

}


public class B {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] magic = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                magic[i][j] = in.nextInt();
            }
        }
        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                if (magic[j][i] == 0) {
                    magic[j][i] = 15 - (magic[j][0] + magic[j][1] + magic[j][2]);
                }
            }
        }

        for (int j = 0; j < 3; j++) {
            for (int i = 0; i < 3; i++) {
                if (magic[i][j] > 9) {
                    magic[i][j] = 1;
                }
            }
        }

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(magic[i][j] + "\t");
            }
            System.out.println();
        }

    }//main Method
}//B Class


import java.util.Scanner;
public class ahmed
{
    public static void main(String args[])
    {
        Scanner scn = new Scanner(System.in);
        int a[] = new int[3];
        int b[] = new int[3];
        int c[] = new int[3];
        int i;
        for(i = 0;i < 3; ++i)
        {
            a[i] = scn.nextInt();
        }
        for(i = 0;i < 3; ++i)
        {
            b[i] = scn.nextInt();
        }
        for(i = 0;i < 3; ++i)
        {
            c[i] = scn.nextInt();
        }
        int a,b,c;
        b = a[2] - b[0];
        c = (a[1] + b[0]) / 2;
        a = (a[1] + b[0] - 2 * a[2]) / 2;
        a[0] = c - b;
        b[1] = c;
        c[2] = c + b;
        for(i = 0;i < 3; ++i)
        {
            System.out.print(a[i] + " ");
        }
        System.out.println();
        for(i = 0;i < 3; ++i)
        {
            System.out.print(b[i] + " ");
        }
        System.out.println();
        for(i = 0;i < 3; ++i)
        {
            System.out.print(c[i] + " ");
        }
    }
}


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package prueba;

import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author USUARIO
 */
public class MagicSquare {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner reader = new Scanner(System.in);  // Create a Scanner object
        int square[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            String[] elemts = reader.nextLine().split(" ");
            for(int j = 0; j < 3; j++){
                square[i][j] = Integer.parseInt(elemts[j]);
            }
        }
        int Rmin = 9999999;
        ArrayList<Integer> aux = new ArrayList();

        aux.add(square[0][1] + square[0][2]);
        aux.add(square[1][0] + square[1][2]);
        aux.add(square[2][0] + square[2][1]);
        aux.add(square[1][0] + square[2][0]);
        aux.add(square[0][1] + square[2][1]);
        aux.add(square[0][2] + square[1][2]);

        for(int elem : aux){
            if (elem < Rmin){
                Rmin = elem;
            }
        }

        for (int i = 1; i < 100001; i++) {
            int R = 2*i + square[0][1] + square[1][0] + square[0][2] + square[2][0];
            int y = (R -( square[0][1] + square[1][0] + square[2][1] + square[1][2]))/2;
            int z = (R -( square[2][1] + square[2][0] + square[0][2] + square[1][2]))/2;
            ArrayList<Integer> equations = new ArrayList();
            equations.add(i + square[0][1] + square[0][2]);
            equations.add(square[1][0] + square[1][0] + y);
            equations.add(square[2][0] + square[2][1] + z);
            equations.add(square[1][0] + square[2][0] + i);
            equations.add(square[0][1] + square[2][1] + y);
            equations.add(square[0][2] + square[1][2] + z);
            equations.add(i + y + z);
            if(equations.stream().distinct().limit(2).count() == 1  && y > 0 && z > 0 ){
                System.out.println(i + " " + square[0][1] + " " + square[0][2]);
                System.out.println(square[1][0] + " " + y + " " +square[1][2]);
                System.out.println(square[2][0] + " " + square[2][1] + " " + z);
                return;
            }
        }

    }
}


import java.util.Scanner;

public class hiijif {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();

        String s=sc.nextLine();
        String s=sc.nextLine();

        int sum1=0,sum2=0;
        boolean p=false;
        sc.close();
        for(int i=0; i<n; i++)
        {
            if(s.charAt(i)=='4')
            {
                if(i<n/2)
                {
                    sum1+=4;
                }
                else
                {
                    sum2+=4;
                }

            }
            else if(s.charAt(i)=='7')
            {
                if(i<n/2)
                {
                    sum1+=7;
                }
                else
                {
                    sum2+=7;
                }
            }
            else
            {
                p=true;
                break;

            }

        }
        if(p)
        {
            System.out.println("NO");
        }
        else if(sum1!=sum2){
            System.out.println("NO");
        }
        else
        {
            System.out.println("YES");
        }
    }

}


public class main{
    public static void main(String[] args){

              Scanner s=new Scanner(System.in);
        int size=s.nextInt();
        String str=s.next();
   int c=0;
   String str1="";
   String str2="";
   int sum=0,s2=0;
   boolean b=true;
   for(int i=0;i<str.length();i++)
   {
       if(!((str.charAt(i)+"").equalsIgnoreCase("4")||(str.charAt(i)+"").equalsIgnoreCase("7")))
       {
           b=false;
           break;
       }
   }
   if(b)
   {

   while(c!=(size/2))
   {
    str1+=str.charAt(c);
    c++;
   }

   while(c!=str.length())
   {
       str2+=str.charAt(c);
       c++;
   }

   for(int i=0;i<str1.length();i++)
   {
       sum+=Integer.parseInt(str1.charAt(i)+"");
       s2+=Integer.parseInt(str2.charAt(i)+"");
   }

   if(sum==s2)
           System.out.println("YES");
   else
           System.out.println("NO");
   }

  else
   {
            System.out.println("NO");
   }

}
}


import java.util.Scanner;
public class main {
    public static void main(String[] args) {
       Scanner s = new Scanner (System.in);

        int sum1=0,sum2=0;
     int x =s.nextInt();
        String f=s.next();
      int y=x/2;
      boolean b=true;
     for(int i =0;i< x/2;i++){
         if ((f.charAt(i)!='7'||f.charAt(i)!='4') || (f.charAt(y)!='4' || f.charAt(y)!='7')){
             b=false;
             break;
         } else {
     sum1+=Integer.parseInt(f.charAt(i)+"");
     sum2+=Integer.parseInt(f.charAt(y)+"");
         y++;
     }}
     if (b||sum1==sum2){
         System.out.println("YES");
     } else {
         System.out.println("NO");
     }

    }
}

import java.util.Scanner;
public class main {
    public static void main(String[] args) {
       Scanner s = new Scanner (System.in);

        int sum1=0,sum2=0;
     int x =s.nextInt();
        String f=s.next();
      int y=x/2;
      boolean b=true;
     for(int i =0;i< x/2;i++){
         if ((f.charAt(i)!='7'||f.charAt(i)!='4') ^ (f.charAt(y)!='4' || f.charAt(y)!='7')){
             b=false;
             break;
         } else {
     sum1+=Integer.parseInt(f.charAt(i)+"");
     sum2+=Integer.parseInt(f.charAt(y)+"");
         y++;
     }}
     if (b){
         System.out.println("YES");
     } else {
         System.out.println("NO");
     }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {
	public static HashMap<Character, Character> hm;

	public static void main(String[] args) throws IOException {
		PrintWriter out = new PrintWriter(System.out);
		StringBuilder sb = new StringBuilder();
		Scanner sc = new Scanner(System.in);
		int n =sc.nextInt() , m=sc.nextInt();
		char x []=( m+"").toCharArray();
		int left=0;
		int right=0;
		boolean yes = true;
		for (int i = 0; i < n/2; i++) {
			if((x[i]!='7' &&x[i]!='4')||(x[n-i-1]!='7'&&x[n-i-1]!='4')){yes=false;break;}
			left+=Integer.parseInt(x[i]+"");
			right+=Integer.parseInt(x[n-i-1]+"");
		}
		if(!yes){out.print("NO");out.flush();out.close();}
		else if(left==right){out.print("YES");out.flush();out.close();}
		else {out.print("NO");out.flush();out.close();}
	}

class Pair
{
	char  x ; int y ;
	Pair(char a , int b)
	{
		x=a;y=b;
	}

}

 class Scanner
{
	StringTokenizer st;
	BufferedReader br;

	public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

	public String next() throws IOException
	{
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException {return Integer.parseInt(next());}

	public long nextLong() throws IOException {return Long.parseLong(next());}

	public String nextLine() throws IOException {return br.readLine();}

	public double nextDouble() throws IOException
	{
		String x = next();
		StringBuilder sb = new StringBuilder("0");
		double res = 0, f = 1;
		boolean dec = false, neg = false;
		int start = 0;
		if(x.charAt(0) == '-')
		{
			neg = true;
			start++;
		}
		for(int i = start; i < x.length(); i++)
			if(x.charAt(i) == '.')
			{
				res = Long.parseLong(sb.toString());
				sb = new StringBuilder("0");
				dec = true;
			}
			else
			{
				sb.append(x.charAt(i));
				if(dec)
					f *= 10;
			}
		res += Long.parseLong(sb.toString()) / f;
		return res * (neg?-1:1);
	}

	public boolean ready() throws IOException {return br.ready();}

}


import java.util.*;

public class Main{
   public static void main(String[] args) {
     Scanner s = new Scanner(System.in);

     int num = s.nextInt();

     int presents = Math.floor(num/3);
     num-=presents*3;
     if(num==1) {
         presents++;
     }

     System.out.print(presents);
    }
}


import java.io.*;
import java.util.*;
import java.math.BigInteger;
import java.lang.Math;

public class A1 {
	public static void main(String[] args) throws IOException {
    Scanner in= new Scanner(System.in);
    long l=in.nextLong();
    if(l%3==0) l=l/3*2;
    else l=l-(l+1)/3;
    System.out.prinln(l);
	}
}


import java.util.Scanner;

public class CF2 {
    Scanner inputScan = Functions.getScannerLocal(); //new Scanner(System.in);
    public static void main(String[] args) {
        CF2 program = new CF2();
        program.execute();
    }

    public void execute()
    {
        int N = inputScan.nextInt();
        int rem = N % 3;
        int result = 2*(N/3);

        if(rem > 0) {
            result++;
        }
        System.out.println(result);
    }
}


import java.util.*;

public class Solution {

  private static Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    int n = sc.nextInt();
    System.out.println(2 * n / 3 + (n % 3 == 0 ? 0 : 1);)
  }

}


/**
 * Created by IntelliJ IDEA.
 * User: aircube
 * Date: 11.01.11
 * Time: 4:14
 * To change this template use File | Settings | File Templates.
 */

import javax.swing.undo.StateEdit;
import java.io.*;
import java.math.*;
import java.util.*;

public class Template {
    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;

    public static void main(String[] args) throws IOException {
        new Template().run();
    }

    void run() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        st = null;
        out = new PrintWriter(System.out) ;

        solve();

        br.close();
        out.close();
    }
    static final long mod = 1000000000 + 7;
    int cnt(int x, int d) {
        int r = 0;
        while (x > 0)  {
            r += x / d;
            x /= d;
        }
        return r;
    }
    long bp(long a, long power) {
        long r = 1;
        for(; power > 0; power >>= 1, a = (a * a) % mod) if ((power & 1) > 0) r = (r * a) % mod;
        return r;
    }
    boolean isprime(int x) {
        for(int i = 2; i * i <= x; ++i)
            if (x % i == 0) return false;
        return true;
    }
    long bp(long a, long power) {
        long r = 1;
        for(; power > 0; power >>= 1, a = (a * a) % mod) if ((power & 1) > 0) r = (r * a) % mod;
        return r;
    }
    long inverse(int a) {
        return bp(a, mod - 2);
    }
    void solve() throws  IOException {
        int n = nextInt();
        // (n + n - 1) ! / n ! / (n - 1) !
        long res = 2;
        for(int i = 1; i <= n + n - 1; ++i) {
            res = (res * i) % mod;
        }
        for(int i = 1; i <= n; ++i) {
            res = (res * inverse(i)) % mod;
        }
        for(int i = 1; i <= n - 1; ++i) {
            res = (res * inverse(i)) % mod;
        }
        res -= n;
        res = (res % mod + mod) % mod;
        out.print(res);

    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    BigInteger nextBigInteger() throws IOException {
        return new BigInteger(nextToken());
    }
    String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}


import java.util.*;

public class Main{
	final long MOD = 1000000007;
	final int N = 100001;
	long f[] = new long[N];
	long qmod(long a, long x, long mod){
		long res = 1, tmp = a % mod;
		while(x != 0){
			if((x & 1) == 1){
				res = res * tmp % mod;
			}
			tmp = tmp * tmp % MOD;
			x >>= 1;
		}
		return res;
	}

	long c(int n, int m)
	{
		return f[n] * qmod(f[n - m] * f[m] % MOD, MOD - 2, MOD) % MOD;
	}
	void run(){
		f[0] = 1;
		for(int i = 1;i < N;i++){
			f[i] = f[i - 1] * i % MOD;
		}
		int n;
		while(cin.hasNext()){
			n = cin.nextInt();
			System.out.println((c(2 * n, n) - n + MOD) % MOD);
		}
	}
	public static void main(String args[]){
		new Main().run();
	}
	private Scanner cin = new Scanner(System.in);
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
//		Scanner r = new Scanner(System.in);
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

		String[] line = r.readLine().split("[ ]+");
		int n= Integer.parseInt(line[0]);
		int m= Integer.parseInt(line[1]);
		int k= Integer.parseInt(line[2]);

		int[][] arr = new int[m][3];

		while(m-->0){
			line = r.readLine().split("[ ]+");
			int i = Integer.parseInt(line[0])-1;
			int j = Integer.parseInt(line[1])-1;
			int start = Integer.parseInt(line[2]);

			arr[arr.length-1-m][0] = i;
			arr[arr.length-1-m][1] = j;
			arr[arr.length-1-m][2] = start;
		}

		long sum = 0 ;
		line = r.readLine().split("[ ]+");
		while(k-->0){
			int index = Integer.parseInt(line[line.length-1-k])-1;
			for (int i = 0; i < arr.length; i++) {
//				if(index<= arr[i][1] && index>=arr[i][0])
					sum+=index-arr[i][0] +arr[i][2];
			}
		}
		System.out.println(sum);

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class D {

	static final int mod = (int)1e9 + 7;
	static long[] fac;

	static long nCr(int n, int r)
	{
		return fac[n] * modPow(fac[r] * fac[n - r] % mod, mod - 2);
	}

	static long modPow(long b, int e)
	{
		long res = 1;
		while(e > 0)
		{
			if((e & 1) == 1)
				res = res * b % mod;
			b = b * b % mod;
			e >>= 1;
		}
		return res;
	}

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		fac = new long[100001];
		fac[0] = 1;
		for(int i = 1; i <= 100000; ++i)
			fac[i] = 1l * fac[i - 1] * i % mod;
		int n = sc.nextInt();
		long f = nCr(2 * n - 1, n - 1);
		out.println((f * 2 - n + mod)%mod);
		out.flush();
		out.close();
	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException
		{
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if(x.charAt(0) == '-')
			{
				neg = true;
				start++;
			}
			for(int i = start; i < x.length(); i++)
				if(x.charAt(i) == '.')
				{
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				}
				else
				{
					sb.append(x.charAt(i));
					if(dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg?-1:1);
		}

		public boolean ready() throws IOException {return br.ready();}

	}
}