#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;
}
