7 3
1 4 7
1 2 2
2 3 3
3 4 8
2 5 1
1 6 4
6 7 5
 10 2
1 5
5 3 2
8 4 8
7 6 9
7 10 1
10 1 4
9 5 1
5 8 2
7 2 9
6 5 6
 10 5
4 8 7 5 1
5 1 1
2 7 1
4 3 1
10 9 1
10 1 1
1 8 1
10 7 1
10 3 1
7 6 1
 10 9
9 7 6 10 3 5 2 8 1
9 4 10
10 8 3
3 6 2
5 1 8
5 2 5
1 10 10
6 7 1
9 1 7
1 6 3
 10 5
8 5 2 10 1
3 1 7
5 4 6
10 8 4
6 8 9
7 8 4
9 5 6
8 1 9
2 10 2
9 8 7

3 2
 2 3
 5 1
 0 1
 5 1

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.io.IOException;
import java.util.Deque;
import java.util.ArrayList;
import java.io.UncheckedIOException;
import java.util.List;
import java.util.stream.Stream;
import java.io.Closeable;
import java.io.Writer;
import java.util.Optional;
import java.io.OutputStreamWriter;
import java.util.ArrayDeque;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 29);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            EPilgrims solver = new EPilgrims();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class EPilgrims {
        Deque<Node> dq;

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.ri();
            int m = in.ri();
            Node[] nodes = new Node[n];
            for (int i = 0; i < n; i++) {
                nodes[i] = new Node();
                nodes[i].id = i;
            }
            for (int i = 0; i < m; i++) {
                nodes[in.ri() - 1].special = true;
            }
            for (int i = 0; i < n - 1; i++) {
                Node a = nodes[in.ri() - 1];
                Node b = nodes[in.ri() - 1];
                Edge e = new Edge();
                e.a = a;
                e.b = b;
                e.c = in.ri();
                a.adj.add(e);
                b.adj.add(e);
            }

            Node first = Arrays.stream(nodes).filter(x -> x.special).findFirst().orElse(null);
            dfsForSize(first, null);

            dfsForDepth(first, null, 0);
            Node end1 = findMax(nodes);
            dfsForDepth(end1, null, 0);
            Node end2 = findMax(nodes);
            int diameter = end2.depth;
            dq = new ArrayDeque<>(n);
            search(end1, null, end2);
            Node left = null;
            Node right = null;
            for (Node node : dq) {
                if (node.depth * 2 <= diameter) {
                    left = node;
                }
                if (right == null && node.depth * 2 >= diameter) {
                    right = node;
                }
            }
            if (left != right) {
                Node a = left;
                Node b = right;
                dfsForDepth(a, b, 0);
                dfsForSize(a, b);
                dfsForDepth(b, a, 0);
                dfsForSize(b, a);
                calcReduce(a, b, a.maxDepth, a.maxDepthCnt, b.maxDepthCnt);
                calcReduce(b, a, b.maxDepth, b.maxDepthCnt, a.maxDepthCnt);
            } else {
                Node center = left;
                dfsForDepth(center, null, 0);
                dfsForSize(center, null);
                if (!center.special) {
                    center.reduce = m;
                }
                List<Node> subtree = new ArrayList<>(n);
                for (Edge e : center.adj) {
                    Node node = e.other(center);
                    if (node.deleted) {
                        continue;
                    }
                    if (node.maxDepth == center.maxDepth) {
                        subtree.add(node);
                    }
                }
                for (Edge e : center.adj) {
                    Node node = e.other(center);
                    if (node.deleted) {
                        continue;
                    }
                    int extra = 0;
                    if (subtree.size() == 2 && node.maxDepth == center.maxDepth) {
                        for (Node other : subtree) {
                            if (other == node) {
                                continue;
                            }
                            extra += other.size;
                        }
                    }
                    calcReduce(node, center, node.maxDepth, node.maxDepthCnt, extra);
                }
            }

            int way = 0;
            int best = -1;
            for (Node node : nodes) {
                if (node.deleted) {
                    continue;
                }
                if (node.reduce > best) {
                    best = node.reduce;
                    way = 0;
                }
                if (node.reduce == best) {
                    way++;
                }
            }
            out.println(best).println(way);
        }

        public Node findMax(Node[] nodes) {
            Node best = null;
            for (Node node : nodes) {
                if (node.deleted) {
                    continue;
                }
                if (best == null || best.depth < node.depth) {
                    best = node;
                }
            }
            return best;
        }

        public void dfsForSize(Node root, Node p) {
            root.size = root.special ? 1 : 0;
            for (Edge e : root.adj) {
                Node node = e.other(root);
                if (node == p || node.deleted) {
                    continue;
                }
                dfsForSize(node, root);
                root.size += node.size;
            }
            if (root.size == 0) {
                root.deleted = true;
            }
        }

        public void dfsForDepth(Node root, Node p, int d) {
            root.depth = d;
            root.maxDepth = root.depth;
            root.maxDepthCnt = 1;
            for (Edge e : root.adj) {
                Node node = e.other(root);
                if (node == p || node.deleted) {
                    continue;
                }
                dfsForDepth(node, root, d + e.c);
                if (node.maxDepth > root.maxDepth) {
                    root.maxDepth = node.maxDepth;
                    root.maxDepthCnt = 0;
                }
                if (node.maxDepth == root.maxDepth) {
                    root.maxDepthCnt += node.maxDepthCnt;
                }
            }
        }

        public void calcReduce(Node root, Node p, int deepest, int total, int extra) {
            if (!root.special) {
                root.reduce += root.size;
                if (deepest == root.maxDepth && root.maxDepthCnt == total) {
                    root.reduce += extra;
                }
            }
            for (Edge e : root.adj) {
                Node node = e.other(root);
                if (node == p || node.deleted) {
                    continue;
                }
                calcReduce(node, root, deepest, total, extra);
            }
        }

        public boolean search(Node root, Node p, Node target) {
            dq.addLast(root);
            if (root == target) {
                return true;
            }
            for (Edge e : root.adj) {
                Node node = e.other(root);
                if (node == p || node.deleted) {
                    continue;
                }
                if (search(node, root, target)) {
                    return true;
                }
            }
            dq.removeLast();
            return false;
        }

    }

    static class FastOutput implements AutoCloseable, Closeable, Appendable {
        private static final int THRESHOLD = 32 << 10;
        private final Writer os;
        private StringBuilder cache = new StringBuilder(THRESHOLD * 2);

        public FastOutput append(CharSequence csq) {
            cache.append(csq);
            return this;
        }

        public FastOutput append(CharSequence csq, int start, int end) {
            cache.append(csq, start, end);
            return this;
        }

        private void afterWrite() {
            if (cache.length() < THRESHOLD) {
                return;
            }
            flush();
        }

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput append(char c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput append(int c) {
            cache.append(c);
            afterWrite();
            return this;
        }

        public FastOutput println(int c) {
            return append(c).println();
        }

        public FastOutput println() {
            return append('\n');
        }

        public FastOutput flush() {
            try {
//            boolean success = false;
//            if (stringBuilderValueField != null) {
//                try {
//                    char[] value = (char[]) stringBuilderValueField.get(cache);
//                    os.write(value, 0, cache.length());
//                    success = true;
//                } catch (Exception e) {
//                }
//            }
//            if (!success) {
                os.append(cache);
//            }
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class Edge {
        Node a;
        Node b;
        int c;

        Node other(Node x) {
            return a == x ? b : a;
        }

        public String toString() {
            return "Edge{" +
                    "a=" + a +
                    ", b=" + b +
                    ", c=" + c +
                    '}';
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int ri() {
            return readInt();
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class Node {
        List<Edge> adj = new ArrayList<>();
        boolean special;
        boolean deleted;
        int size;
        int depth;
        int maxDepth;
        int maxDepthCnt;
        int reduce;
        int id;

        public String toString() {
            return "" + (id + 1);
        }

    }
}

