#include <bits/stdc++.h>
using namespace std;
vector<int> E[705];
struct bigint {
  long long a[30] = {};
  int l;
  void operator=(int b) {
    l = b == 0;
    while (b) a[++l] = b % 100000000, b /= 100000000;
  }
  bool operator<(const bigint &b) const {
    if (l != b.l) return l < b.l;
    for (int i = l; i >= 1; i--)
      if (a[i] != b.a[i]) return a[i] < b.a[i];
    return false;
  }
  bigint operator*(const bigint &b) const {
    bigint c;
    for (int i = 1; i <= l; i++)
      for (int j = 1; j <= b.l; j++) {
        c.a[i + j - 1] += a[i] * b.a[j];
        c.a[i + j] += c.a[i + j - 1] / 100000000;
        c.a[i + j - 1] %= 100000000;
      }
    c.l = l + b.l - 1;
    if (c.a[c.l + 1]) c.l++;
    return c;
  }
  void out() {
    printf("%lld", a[l]);
    for (int i = l - 1; i >= 1; i--) printf("%08lld", a[i]);
  }
} dp[705][705];
int n, a, b;
int Size[705];
void dfs(int x, int f) {
  Size[x] = 1, dp[x][1].a[1] = 1;
  for (int i = 0; i < E[x].size(); i++) {
    int u = E[x][i];
    if (u == f) continue;
    dfs(u, x);
    for (int j = Size[x]; j; j--)
      for (int k = Size[u]; ~k; k--) {
        bigint t = dp[x][j] * dp[u][k];
        if (dp[x][j + k] < t) dp[x][j + k] = t;
      }
    Size[x] += Size[u];
  }
  for (int i = 1; i <= Size[x]; i++) {
    bigint t;
    t.l = 1, t.a[1] = i;
    t = dp[x][i] * t;
    if (dp[x][0] < t) dp[x][0] = t;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &a, &b);
    E[a].push_back(b);
    E[b].push_back(a);
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= n; j++) dp[i][j].l = 1;
  dfs(1, 0);
  dp[1][0].out();
}
