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>
const int MAX_N = 1e5;
const int LOG_MAX_N = 17;
bool isMonastery[1 + MAX_N];
struct Edge {
  int v;
  int w;
};
struct VertexData {
  int maxDist;
  int lca;
};
VertexData join(const VertexData &a, const VertexData &b, int v) {
  if (a.maxDist == b.maxDist) {
    return VertexData{a.maxDist, v};
  } else if (a.maxDist < b.maxDist) {
    return b;
  } else {
    return a;
  }
}
std::vector<Edge> neighbours[1 + MAX_N];
std::vector<Edge> children[1 + MAX_N];
int depth[1 + MAX_N];
int ancestors[1 + MAX_N][1 + LOG_MAX_N];
VertexData vertexData[1 + MAX_N];
int counter[1 + MAX_N];
VertexData operator+(VertexData a, int w) {
  a.maxDist += w;
  return a;
}
void dfs1(int u) {
  if (isMonastery[u]) {
    vertexData[u] = VertexData{0, u};
  } else {
    vertexData[u] = VertexData{(int)-1e9, u};
  }
  for (const Edge &e : neighbours[u]) {
    if (e.v != ancestors[u][0]) {
      children[u].push_back(e);
      ancestors[e.v][0] = u;
      for (int i = 1; i <= LOG_MAX_N; i++) {
        ancestors[e.v][i] = ancestors[ancestors[e.v][i - 1]][i - 1];
      }
      depth[e.v] = depth[u] + 1;
      dfs1(e.v);
      vertexData[u] = join(vertexData[u], vertexData[e.v] + e.w, u);
    }
  }
}
int lca(int u, int v) {
  for (int i = LOG_MAX_N; i >= 0; i--) {
    if (depth[ancestors[u][i]] >= depth[v]) {
      u = ancestors[u][i];
    }
    if (depth[ancestors[v][i]] >= depth[u]) {
      v = ancestors[v][i];
    }
  }
  if (u != v) {
    for (int i = LOG_MAX_N; i >= 0; i--) {
      if (ancestors[u][i] != ancestors[v][i]) {
        u = ancestors[u][i];
        v = ancestors[v][i];
      }
    }
    u = ancestors[u][0];
    v = ancestors[v][0];
  }
  return u;
}
void increment(int u, int v) {
  counter[u]++;
  counter[v]++;
  int l = lca(u, v);
  counter[l]--;
  counter[ancestors[l][0]]--;
}
void dfs2(int u, VertexData parent) {
  vertexData[u] = join(vertexData[u], parent, u);
  if (isMonastery[u]) {
    increment(u, vertexData[u].lca);
  }
  if (children[u].size() > 0) {
    VertexData pref[children[u].size()];
    VertexData suff[children[u].size()];
    pref[0] = vertexData[children[u][0].v] + children[u][0].w;
    for (int i = 1; i < (int)children[u].size(); i++) {
      const Edge &e = children[u][i];
      pref[i] = join(pref[i - 1], vertexData[children[u][i].v] + e.w, u);
    }
    suff[children[u].size() - 1] =
        vertexData[children[u].end()[-1].v] + children[u].end()[-1].w;
    for (int i = (int)children[u].size() - 2; i >= 0; i--) {
      const Edge &e = children[u][i];
      suff[i] = join(suff[i + 1], vertexData[children[u][i].v] + e.w, u);
    }
    for (int i = 0; i < (int)children[u].size(); i++) {
      const Edge &e = children[u][i];
      VertexData send = parent;
      if (0 <= i - 1) {
        send = join(send, pref[i - 1], u);
      }
      if (i + 1 < (int)children[u].size()) {
        send = join(send, suff[i + 1], u);
      }
      dfs2(e.v, send + e.w);
    }
  }
}
void dfs3(int u) {
  for (const Edge &e : neighbours[u]) {
    if (e.v != ancestors[u][0]) {
      dfs3(e.v);
      counter[u] += counter[e.v];
    }
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int monastery;
    scanf("%d", &monastery);
    isMonastery[monastery] = true;
  }
  for (int i = 0; i < n - 1; i++) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    neighbours[a].push_back(Edge{b, c});
    neighbours[b].push_back(Edge{a, c});
  }
  depth[1] = 1;
  dfs1(1);
  if (isMonastery[1]) {
    dfs2(1, VertexData{0, 1});
  } else {
    dfs2(1, VertexData{(int)-1e9, 0});
  }
  dfs3(1);
  int answerSize = -1;
  int answerCount = 0;
  for (int i = 1; i <= n; i++) {
    if (!isMonastery[i]) {
      if (answerSize < counter[i]) {
        answerSize = counter[i];
        answerCount = 1;
      } else if (answerSize == counter[i]) {
        answerCount++;
      }
    }
  }
  printf("%d %d\n", answerSize, answerCount);
  return 0;
}
