#include const int Mod = 998244353; typedef struct Edge { struct Edge *next; int v; } edge; int main() { int i, N, u, w; edge *adj[100001] = {}, e[200001], *p; scanf("%d", &N); for (i = 0; i < N - 1; i++) { scanf("%d %d", &u, &w); e[i*2].v = w; e[i*2+1].v = u; e[i*2].next = adj[u]; e[i*2+1].next = adj[w]; adj[u] = &(e[i*2]); adj[w] = &(e[i*2+1]); } int par[100001] = {}, q[100001], head, tail; q[0] = 1; par[1] = 1; for (head = 0, tail = 1; head < tail; head++) { u = q[head]; for (p = adj[u]; p != NULL; p = p->next) { w = p->v; if (par[w] == 0) { par[w] = u; q[tail++] = w; } } } long long dp[100001][3], tmp[3]; for (head--; head >= 0; head--) { u = q[head]; if (adj[u]->next == NULL && par[u] == adj[u]->v) { dp[u][0] = 0; dp[u][1] = 1; dp[u][2] = 0; continue; } dp[u][0] = 0; dp[u][1] = 1; dp[u][2] = 1; for (p = adj[u]; p != NULL; p = p->next) { w = p->v; if (w == par[u]) continue; tmp[0] = (dp[u][0] * dp[w][0] + dp[u][1] * dp[w][1]) % Mod; tmp[1] = (dp[u][1] * dp[w][0] + dp[u][2] * dp[w][1]) % Mod; tmp[2] = dp[u][2] * dp[w][0]; for (i = 0; i < 3; i++) dp[u][i] = tmp[i]; } } printf("%lld\n", dp[1][0]); fflush(stdout); return 0; }