Computing a global thread index from blockIdx and threadIdx

The kernel below is launched as writeIndex<<<4, 256>>>(out). For the thread with blockIdx.x == 2 and threadIdx.x == 10, what value does that thread write into out?

kernel.cu
__global__ void writeIndex(int* out) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    out[idx] = idx;
}

1 of 46 in GPU / CUDA