ll@H,@W,a[H][W][2d2]{{{0,1}}},d;string@A[H];rep(i,H)rep(j,W)rep(c,2d2)d=A[i][j]=='o'?c-1:A[i][j]=='x'?d+1:-1,a[i][j][c]+=0<=d<2d2?(i&&A[i-1][j]!='#'?a[i-1][j][d]:0)+(j&&A[i][j-1]!='#'?a[i][j-1][d]:0):0;wt(sum[c,0,2d2](a[H-1][W-1][c]));