#include <bits/stdc++.h>
const int N = 705, size = 10000;
int f[N][N][60], s[N], son[N], ed[N * 2], next[N * 2], d[60], tmp[60], n, x, y,
    z, l;
void mul(int *c, int *a, int *b) {
  for (int i = 1; i <= 55; i++) c[i] = 0;
  c[0] = a[0] + b[0] + 3;
  for (int i = 1; i <= a[0]; i++)
    for (int j = 1; j <= b[0]; j++) c[i + j - 1] += a[i] * b[j];
  for (int i = 1; i <= c[0]; i++) c[i + 1] += c[i] / size, c[i] %= size;
  while (c[0] && !c[c[0]]) c[0]--;
}
bool big(int *a, int *b) {
  if (a[0] < b[0]) return 0;
  if (a[0] > b[0]) return 1;
  for (int i = a[0]; i; i--) {
    if (a[i] < b[i]) return 0;
    if (a[i] > b[i]) return 1;
  }
  return 0;
}
void updata(int *a, int *b, int *c) {
  mul(tmp, b, c);
  if (big(tmp, a)) memcpy(a, tmp, sizeof(tmp));
}
void prt(int *a) {
  printf("%d", a[a[0]]);
  for (int i = a[0] - 1; i; i--) printf("%04d", a[i]);
  printf("\n");
}
void dfs(int x, int last) {
  s[x] = 1;
  f[x][1][0] = f[x][1][1] = 1;
  for (int p = son[x]; p; p = next[p]) {
    int y = ed[p];
    if (y == last) continue;
    dfs(y, x);
    for (int i = s[x]; i >= 0; i--)
      for (int j = s[y]; j >= 0; j--) updata(f[x][i + j], f[x][i], f[y][j]);
    s[x] += s[y];
  }
  memset(d, 0, sizeof(d));
  d[0] = 1;
  for (int i = 1; i <= s[x]; i++) d[1]++, updata(f[x][0], f[x][i], d);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++)
    scanf("%d%d", &x, &y), ed[++l] = y, next[l] = son[x], son[x] = l,
                           ed[++l] = x, next[l] = son[y], son[y] = l;
  dfs(1, 0);
  prt(f[1][0]);
  return 0;
}
