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

#include <bits/stdc++.h>
using namespace std;
struct OP {
  int w;
  int nod;
  int val;
  OP(int a, int b, int c) { w = a, nod = b, val = c; }
};
list<pair<int, int> > ls[100100];
vector<int> adj[100100];
vector<OP> ops[100100];
int hei[100100], anc[100100][21];
int sum[100100];
bool eh[100100];
void rec(int v, int p, int& valo, int& node) {
  for (list<pair<int, int> >::iterator it = ls[v].begin(); it != ls[v].end();) {
    int w = it->first;
    if (w == p)
      it++;
    else {
      int val, nod;
      rec(w, v, val, nod);
      val += it->second;
      if (nod) {
        if (ops[v].size() < 3)
          ops[v].push_back(OP(w, nod, val));
        else {
          OP op(w, nod, val);
          for (int i = 0; i < ops[v].size(); i++) {
            if (op.val > ops[v][i].val) swap(op, ops[v][i]);
          }
        }
      }
      it = ls[v].erase(it);
    }
  }
  valo = 0;
  node = eh[v] ? v : 0;
  for (int i = 0; i < ops[v].size(); i++) {
    if (ops[v][i].w != p) {
      if (valo < ops[v][i].val)
        valo = ops[v][i].val, node = ops[v][i].nod;
      else if (valo == ops[v][i].val)
        node = v;
    }
  }
}
void reclca(int v, int p, int h) {
  anc[v][0] = p;
  hei[v] = h;
  for (int i = 0; i < adj[v].size(); i++) {
    if (adj[v][i] != p) reclca(adj[v][i], v, h + 1);
  }
}
void prelca(int n) {
  for (int j = 1; j < 21; j++)
    for (int i = 1; i < n + 1; i++) anc[i][j] = anc[anc[i][j - 1]][j - 1];
}
int lca(int a, int b) {
  if (hei[a] < hei[b]) swap(a, b);
  for (int i = 20; i >= 0; i--) {
    if (hei[anc[a][i]] >= hei[b]) a = anc[a][i];
  }
  if (a == b) return a;
  for (int i = 20; i >= 0; i--) {
    if (anc[a][i] != anc[b][i]) a = anc[a][i], b = anc[b][i];
  }
  return anc[a][0];
}
void rec(int v, int p) {
  for (int i = 0; i < adj[v].size(); i++) {
    if (adj[v][i] != p) {
      rec(adj[v][i], v);
      sum[v] += sum[adj[v][i]];
    }
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a;
    scanf("%d", &a);
    eh[a] = true;
  }
  for (int i = 1; i < n; i++) {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    ls[a].push_front(make_pair(b, c));
    ls[b].push_front(make_pair(a, c));
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  reclca(1, 0, 0);
  prelca(n);
  for (int i = 1; i < n + 1; i++) {
    if (eh[i]) {
      int vv, nn;
      rec(i, -1, vv, nn);
      if (nn != i) {
        int w = lca(i, nn);
        if (w == i || w == nn)
          sum[w ^ i ^ nn]++, sum[anc[w][0]]--;
        else
          sum[i]++, sum[nn]++, sum[w]--, sum[anc[w][0]]--;
      }
    }
  }
  rec(1, -1);
  int maxi = 0, qtd = 0;
  for (int i = 1; i < n + 1; i++) {
    if (!eh[i]) {
      if (sum[i] > maxi)
        maxi = sum[i], qtd = 1;
      else if (sum[i] == maxi)
        qtd++;
    }
  }
  printf("%d %d\n", maxi, qtd);
  return 0;
}
